Example 2 Find a polynomial $P(x)$ such that $P(0)=0$, and for all real numbers $x$, the equation $P\left(x^{2}+1\right)=$ $[P(x)]^{2}+1$ holds.
(Putnam 32 problem)
Given the known equation, let $x=0$. Since $P(0)=0$, we get $P(1)=1$. Let $x=1$ in the known equation, we get $P(2)=2$. Similarly, we have $P(5)=5, P(26)=26, P\left(26^{2}+1\right)=26^{2}+1, \cdots$ Thus, the polynomial $F(x)=$ $P(x)-x$ has infinitely many roots: $0,1,2,5,26,26^{6}+1, \cdots$ Therefore, the polynomial $F(x)$ is the zero polynomial, i.e., $P(x)=x$.

On the other hand, $P(x)=x$ satisfies the known equation and $P(x)=0$, so $P(x)=x$ is the unique polynomial sought.