Example 5 Determine all polynomials $p(x)$ that satisfy the following conditions:
$$
p\left(x^{2}+1\right)=[p(x)]^{2}+1, p(0)=0.
$$
(32nd Putnam $A-2$)
Given $p(0)=0, p(1)=[p(0)]^{2}+1=1, p(2)=[p(1)]^{2}+1=1$, $p(5)=[p(2)]^{2}+1=5, p\left(5^{2}+1\right)=[p(5)]^{2}+1=26, \cdots$

That is, $p(x)$ has infinitely many fixed points $0,1,2,5,26, \cdots$ Also, $p(x)$ is a polynomial, so the equation $p(x)-x=0$ is an algebraic equation. A univariate $n$-degree algebraic equation has only $n$ roots, hence
$p(x)-x \equiv 0$, i.e., $p(x)=x$.
On the other hand, $p(x)=0$ satisfies $p(0)=0$ and $p\left(x^{2}+1\right)=[p(x)]^{2}+1$, so $p(x)=x$ is the unique polynomial sought.