Let $k$ be a positive integer. Find all polynomials with real coefficients which satisfy the equation $P(P(x))=\left(P(x)\right)^k$. 
Let $k$ be a positive integer. Find all polynomials with real coefficients which satisfy the equation $$P(P(x))=\left(P(x)\right)^k.$$

I simply don't even know how to  think about this problem.
I've tried simple stuff just to get my head on the problem.
For example for $P(x)=x^n$ I have $P(P(x))=(P(x))^n$, and I think that any polynomial $P(x)=x^n+x^{n-1} +\cdots +c$ can't be a solution as I would have $P(x)=P(x)q_1(x) +R $.
After that I simply stare at the problem.
Can you guys give some help ?
Note: I would like to understand how to tackle these kind of problems, so I would be really grateful if you would explain the thinking process behind the solution. (This is optional, so feel free to give an answer as you prefer.)
Thanks in advance.
 A: First we note that only the constant polynomials $P \equiv 0$ and $P \equiv 1$, as well als $P \equiv -1$ for odd $k$, satisfy the equation. (This holds true for $k>1$; for $k=1$ any constant polynomial will do.)
Now if $P$ is not constant, then the range $Y = \{ P(x) : x \in \mathbb{R} \}$ of $P$ is an infinite set. For every $y \in Y$ we have $P(y) = y^k$, which means that the polynomial $Q(x) = P(x) - x^k$ is zero on $Y$. Since $Y$ is infinite, this implies that $Q$ is the zero polynomial. In conclusion, $P(x) = x^k$.
A: Note, first, that if $P$ is constant, then $P = P^k$, so $P$ can be any real solution of the equation $u^k - u = 0$. From now on, we shall assume that $P$ is not constant.
Let $P = cx^n + Q$ with $n \ge 1$, $c \ne 0$ and $\deg Q < n$. The equality $P(P(x)) = (P(x))^k$ means $c (cx^n + Q)^n + Q = (cx^n + Q)^k$. Developing this and equating the terms of highest degree, we get that $c^{n+1} x^{n^2} = c^k x^{nk}$, so $n = k$, which implies $c^{k+1} = c^k$. Since $c \ne 0$ we get $c = 1$.
Rewriting the conclusion above gives $(x^k + Q)^k + Q = (x^k + Q)^k$, i.e. $Q=0$, so $P = x^k$.
Therefore, the only solutions are the roots of the equation $u^k - u = 0$ and $x^k$.
A: Let $\deg(P(x))=n$,then $\deg(P(P(x)))=n^2,\deg(P(x))^k=nk$,so
$n=k$ or $n=0$,
if $n=0$, it easy to find $P(x)=1$
if $n=k$, then let
$$P(x)=a_{k}x^k+a_{k-1}x^{k-1}+\cdots+a_{0}$$
then 
$$[x^{k^2}](P(P(x))=(a_{k})^{k+1},[x^{k^2}](P(x))^k=(a_{k})^k$$
so we have
$$a_{k}=1$$
so
$$P(x)=x^k+a_{k-1}x^{k-1}+\cdots+a_{0}$$
so we have
$$P(P(x))=(x^k+a_{k-1}x^{k-1}+\cdots+a_{0})^k+a_{k-1}(x^k+a_{k-1}x^{k-1}+\cdots+a_{0})^{k-1}+\cdots+a_{0}$$
and
$$(P(x))^k=(x^k+a_{k-1}x^{k-1}+\cdots+a_{0})^k$$
so have
$$a_{k-1}=a_{k-2}=\cdots=a_{0}=0$$
A: Suppose P(x) is a polynomial of order n. 
Thus:
$P(x)=\sum_{r=o}^{n}a_{r}x^{r}$.
And so we have:
$P(P(x))=P(\sum_{r=o}^{n}a_{r}x^{r})= \sum_{r=o}^{n}a_{r}(\sum_{r=o}^{n}a_{r}x^{r})^{r}$.
From this we can deduce that $P(P(x))$ is of order $n^{2}$.
Now $[P(x)]^{k} =[\sum_{r=o}^{n}a_{r}x^{r}]^{k} $, hence $[P(x)]^{k}$ is of the order $nk$.
Since these polynomials are the same, they must be of the same order, hence,
$nk=n^{2}$ and rearranging gives $0=n(n-k)$. 
Assuming that the polynomial is non constant, (i.e isn't of $0th$ order) we must therefore conclude that $n=k$.
Note that:
$P(P(x))=a_{n}(a_{n}x^{n}+a_{n-1}x^{n-1}+...+a_{0})^{n}+\sum_{r=o}^{n-1}a_{r}(\sum_{r=o}^{n}a_{r}x^{r})^{r}$
And that:
$[P(x)]^{n} =(a_{n}x^{n}+a_{n-1}x^{n-1}+...+a_{0})^{n}=(a_nx^{n})^{n} +Q(x)+(a_{0})^{n}$ where $Q(x)$ is the rest of the polynomial that isn't really relevant to this argument.
Comparing the coefficients of $x^{n}$ leads us to conclude that $(a_{n})^{n+1} =(a_{n})^{n}$, thus $a_{n}=1$.
Thus we have $P(P(x))=(x^{n}+a_{n-1}x^{n-1}+...+a_{0})^{n} +\sum_{r=o}^{n-1}a_{r}(\sum_{r=o}^{n}a_{r}x^{r})^{r}=[P(x)]^{n}=(x^{n}+a_{n-1}x^{n-1}+...+a_{0})^{n}$.
Thus:$\sum_{r=o}^{n-1}a_{r}(\sum_{r=o}^{n}a_{r}x^{r})^{r}=0$
Hence $a_{r}$=0 for all $r=0,1,2,3,...,n-1$.
A: Let $\deg p = n$. Then we have $n^2 = nk$, thus $n = 0$ or $n = k$.
If $n = 0$, let $p (x) = c$, where $c$ is a constant. Then we have $c = c^k$, which implies $p (x) \equiv 0$ or $p (x) \equiv \pm 1$.
Assume now $n = k$. Then, $$p (x) = c x^k + q (x),$$ where $\deg q < k$. By the original equation, we have $$c (c x^k + q (x))^k + q (x) = (c x^k + q (x)) ^k$$ and $c^{k + 1} = c^k$, so $c = 1$. Then, $p (x) = x^k + q (x)$. Therefore, $$(x^k + q(x))^k + q (x) = (x^k + q (x))^k,$$ by which we have $q (x) \equiv 0$. Hence, $p (x) = x^k$.
Edit: Now that I saw the other answers, I think all of our solutions are somewhat the same.
