Find all $P$ with $P(x^2)=P(x)^2$

The following problem is from Golan's book on linear algebra, chapter 4. I have posted a proposed answer below.

Problem: Let $F$ be a field. Find all nonzero polynomials $P\in F[x]$ satisfying

$$P(x^2)=[P(x)]^2.$$

-

Your approach is generally good, though the execution might perhaps leave something to be desired.

Let $F$ be of characteristic different from $2$; we may assume $p(x)\neq 0$. Let $a_nx^n$ be the term of lowest degree. Then the term of lowest degree of $p(x^2)$ is $a_nx^{2n}$, and that of lowest degree in $p(x)^2$ is $a_n^2x^{2n}$, so $a_n=a_n^2$. The only solutions in a field are $0$ and $1$ (they must be roots of $x^2-x$), and since $a_n\neq 0$, we conclude $a_n=1$. Now assume that there exists $m\gt n$ such that $a_m\neq 0$, and pick $m$ to be the smallest such. Then $p(x) = x^n + a_mx^m + (\text{terms of higher degree})$, so $$p(x^2) = ax^{2n} + a_mx^{2m} + (\text{terms of higher degree}),$$ whereas \begin{align*} p(x)^2 &= (x^{n} + a_mx^{m} + (\text{terms of higher degree}))(x^{n} + a_mx^{m} + (\text{terms of higher degree}))\\ &= x^{2n} + 2a_mx^{n+m} + (\text{terms of higher degree}). \end{align*} Since $n+m\lt 2m$ and $2a_m\neq 0$, this is a contradiction. Therefore, $p(x) = x^n$. And since these clearly "work", it follows that the only polynomials with the desired property are the nonnegative powers of $x$ and the zero polynomial.

Now assume that $F$ is of characteristic $2$. If $p(x) = a_0 + a_1x+ \cdots + a_nx^n$, then \begin{align*} p(x^2) = a_0 + a_1x^2 + a_2x^4 + \cdots + a_nx^{2n}\\ p(x)^2 = a_0^2 + a_1^2x^2 + a_2^2x^4 + \cdots + a_n^2x^{2n}. \end{align*} Therefore, if $p(x^2) = p(x)^2$, then $a_i^2 = a_i$ for all $i$, so $a_i=0$ or $a_i=1$ for all $i$. Thus, $p(x)\in\mathbb{F}_2[x]$. And all of these work. Thus, for fields of characteristic $2$, the polynomials that work are all polynomials over the prime field (all coefficients equal to either $0$ or $1$).

-

Assume first that $F$ is a field with characteristic not equal to 2. The only ones are 1 and $x^n$, $n\in \mathbb{N}$.

Let $a_n$ denote the coefficient of $x^n$ in $P$. We see immediately that all $a_n=0$ for odd $n>0$. Examining the constant coefficient, we see $a_0=a_0^2\Rightarrow a_0=1$ or $a_0=0$.

Now proceed by induction. Consider the case where $a_0=1$. Assume we have shown $a_n=0$ for all $n<k$, $n\neq 1$. We will show $a_k=0$. If $k$ is odd, we are done. If $k$ is even, the coefficient of $x^{k}$ in $P(x^2)$ is $a_{k/2}$, so it is 0. We evaluate $[P(x)]^2$ and ignore higher order terms, and see

$$(a_kx^{k}+1)^2=a_k^2x^{2k}+2a_kx^k+1$$

and the only way for the coefficient of $x^k$ to vanish here is for $a_k$ to be 0.

The case with $a_0=0$ is similar. Assume we have shown $a_n=0$ for all $n<k$. The coefficient of $x^{2k}$ in $P(x^2)$ is $a_{k}$. If evaluate $[P(x)]^2=[...a_kx^k]^2$ and ignore higher order terms again, we get $a_k^2x^{2k}$. So $a_k=1$ or $a_k=0$. If $a_k=0$, we continue the induction. If $a_k=1$, we factor $x^k$ out of the original polynomial and are reduced to the first case.

In a field of characteristic 2 however, I believe that any polynomial with all coefficients equal to 0 or 1 works. Just use the "freshman's dream." Further, because equating constants on both sides gives $a_n^2=a_n$, these are the only ones that work.

-
If $p(x) = x$, then $p(x^2) = x^2$, and $(p(x))^2 = x^2$. But you claimed it was only even powers of $x$... So I don't "see immediately" that $a_n=0$ for all odd $n$. In fact, for any $k$, $x^k$ works, since $p(t) = t^k$ means $p(x^2) = x^{2k} = (x^k)^2 = p(x)^2$. –  Arturo Magidin May 31 '12 at 3:15
Oops. Let me fix this. –  Potato May 31 '12 at 3:16
Also, the answer may depend on the field? If $F=\mathbb{F}_2$, then $(a+b)^2 = a^2+b^2$, so for example $p(x) = x+1$ has the desired property. –  Arturo Magidin May 31 '12 at 3:17
You still have the left-over error of thinking the odd coefficients must be zero, when you say (second line, third paragraph) "if $k$ is odd we are done". –  Arturo Magidin May 31 '12 at 3:27
Same field $F[\alpha]$. What about $x^2+\alpha x$? Constant term is $0$, so you claim it will work... –  Arturo Magidin May 31 '12 at 3:49