I have doubts wrt my solution for the following problem. Determine every polynomial with real coefficients such that $P(P(x))=[P(x)]^k$
My guess is that $P(x)=x^k$. I started by saying let $r_n \in \mathbb{C}$ such that $P(r_n)=n$. Hence, $P(P(r_n))=P(r_n)^k$ implies $P(n)=n^k$. Since $P(n)=x^k$ for $x\in \mathbb{Z}$, we have $P(n)\equiv x^k$
My main point of concern is that I went from the Reals to Complex field to obtain $r_n$, how legitimate is this approach?
This is a similar approach, without needing complex numbers, only that the range of $P$ is infinite.
If $P(x)$ is not constant, then $P(y)-y^k$ has infinitely many roots, name when $y$ is in the range of $P.$
So $P(x)-x^k$ must be the zero polynomial.
Then you also have two or three constant polynomial options for $P,$ when $k$ is even or odd, respectively.