Determine all real polynomials $P$ such that $P(0)=0$ and $P\left(X^{2}+1\right)=P(X)^{2}+1$.
Let $P$ satisfy the equation. By evaluating at $0, P(1)=1$. By evaluating at $1, P(2)=2$. By evaluating at 2, $P(5)=5$. It seems that by iterating, we obtain many integers $n$ such that $P(n)=n$.

Define the sequence by recursion: set $u_{0}=0$ and $u_{n+1}=u_{n}^{2}+1$. It is easy to show with the equation by induction on $n$ that $P\left(u_{n}\right)=u_{n}$, that $u_{n} \in \mathbb{N}$ for all positive integer $n$. Moreover, $u_{n+1}>u_{n}^{2} \geqslant u_{n}$ since $u_{n}\left(u_{n}-1\right) \geqslant 0$ as $u_{n}$ is a positive integer.

Thus the sequence $\left(u_{n}\right)$ is strictly increasing, hence contains an infinity of terms which are roots of $P(X)-X$. Therefore, $P(X)-X$ is the zero polynomial, so $P(X)=X$.

Conversely, if $P(X)=X$, we indeed have $P(0)=0$ and $P\left(X^{2}+1\right)=X^{2}+1=P(X)^{2}+1$, so this is the unique solution to this equation.