A question about polynomial function equations 
Assume $f(x)$ is a polynomial, and satisfies $$f(x^2)=f^2(x),f(0)=1$$
  How to find $f(x)$?

My try: Let $g(x)=f(x)-1$, and then I want to show the roots of $g(x)$ is greater than its degree, so that $g(x)=0$ as desired.
Use the assumption, I get 
\begin{align}
g(x^2)&=f(x^2)-1\\
 &=f^2(x)-1\\
 &=(f(x)+1)(f(x)-1)\\
 &=(f(x)+1)g(x)
\end{align}
so the roots of $g(x)$ are all the roots of $g(x^2)$.
But after that I don't have any idea.
Hope for your help.  
 A: Let $$f(x)=a_0+a_1x+\cdots+a_nx^n$$ so $f(0)=1$ means that $a_0=1$.
Now $f(x^2)=f^2(x)$ implies that $$1+a_1x^2+\cdots+a_nx^{2n}=(1+a_1x+\cdots+a_nx^n)^2$$
What we can observe is that on the RHS, there are odd powers absent on the LHS, so they must equate to zero, for some positive combinations of $a_i$. However, we can also see that $a_n^2=a_n\implies a_n=0,1$. 
But if $a_n=1$ then the coefficient of $x^{2n-1}$  on the RHS would be $$2a_{n-1}=0\implies a_{n-1}=0$$ since the LHS has only odd powers. Continuing in this way, we find that $a_i=0$ for all $i>1$.
Thus $f(x)=1$.
A: Assume that $f$ is a polynomial such that $f(X)^2 = f(X^2)$. Let us prove that the only root of $f$ is zero, or that $f=0$.
Let $z = re^{i\theta} \in \mathbb{C}$ be a root of $f$, with $r > 0$ and $\theta \in (0,2\pi]$. By induction, let us prove that for all $k \in \mathbb{N}$, $r^{1/2^k} \cdot e^{i\theta/2^k}$ is a root of $f$.
Base case: for $k = 0$, this amounts to say that $r$ is a root of $f$.
Inductive step: if it holds for $k \in \mathbb{N}$, then $f\big(r^{1/2^{k+1}}\cdot e^{i\theta/2^{k+1}}\big)^2 = f\big(r^{1/2^k}e^{i\theta/2^k}\big)=0$ using the hypothesis on $f$.
Now for $k \neq k'$ integers, $\frac{\theta}{2^k} \neq \frac{\theta}{2^{k'}} \pmod{2\pi}$ (as $\theta \in (0,2\pi]$, both fractions are in $(0,2\pi]$ and the fractions are different). Hence $r^{1/2^k}\cdot e^{i\theta/2^k} \neq r^{1/2^{k'}}\cdot e^{i\theta/2^{k'}}$ because $r > 0$. Thus $f$ has an infinite number of different roots, so $f$ is zero. Conversely, if $f$ is not zero, then its only root is zero, so we can write $f(X) = cX^p$ for some $p \in \mathbb{N}$, $c \in \mathbb{C}$. Then $f(1)^2=f(1^2)$ becomes $c^2=c$, and thus $c=1$, as $f$ is not zero. We can conclude : 

If $f(X^2)=f(X)^2$, then we can write $f(X) = X^p$ for some $p \in \mathbb{N}$, or $f = 0$.

As you also want $f(0) = 1$, you have to take $p = 0$, so $f=1$.
