Find all polynomials $P$ with real coefficients such that $P(0)=0$ and $P\left(X^{2}+1\right)=$ $P(X)^{2}+1$.


The statement gives $P(0)=0$. By taking $x=0$ in the functional relation of $P$, we get $P\left(0^{2}+1\right)=P(0)^{2}+1$ which is $P(1)=1$. By taking $x=1$, it follows that $P(2)=2$, and then successively $P(5)=5, P(26)=26$, etc. An immediate induction shows that the sequence defined by $u_{0}=0$ and $u_{n+1}=u_{n}^{2}+1$ satisfies $P\left(u_{n}\right)=u_{n}$ for all integer $n$. The polynomial $P(X)-X$ thus has an infinite number of roots: the terms of the sequence $u_{n}$. It is therefore null and we conclude that $P(X)=X$ is the only solution to the problem.