$P(x)=x^2-2x+1$
$P(x+1)P(x-1)=P(P(x))$
Let's say that $P(x)$ has degree $n$. That means that $P(x+1)$ and $P(x-1)$ will each have degree $n$ too. Their product will consequently be of degree $2n$ (because $x^n$ times $x^n$ is $x^{2n}$).
The right-hand side will have a degree of $n^2$ because $P(x)$ is of degree $n$ and $P(\textit{something of degree n})$ will return something of degree $n^2$.
We can therefore conclude since both sides must have the same degree, that $n^2=2n$ and $n$ either equals $2$ or $0$. A zero-degree polynomial is a cheeky answer, so let's just say that $P(x)$ is of degree $2$, or a quadratic.
$P(x)=ax^2+bx+c$
$P(x+1)=a(x+1)^2+b(x+1)+c=a(x^2+2x+1)+b(x+1)+c=ax^2+2ax+a+bx+b+c$
$P(x-1)=a(x-1)^2+b(x-1)+c=a(x^2-2x+1)+b(x-1)+c=ax^2-2ax+a+bx-b+c$
$P(x+1)P(x-1)=(ax^2+2ax+a+bx+b+c)(ax^2-2ax+a+bx-b+c)$
Getting a calculator to evaluate this...
$\space=(a^2 - b^2 + 2 a c + c^2)+ (- 2 a b + 2 b c )x+( - 2 a^2 + b^2 + 2 a c)x^2 + (2 a b) x^3 + (a^2 )x^4$
Next up is evaluating that $P(P(x))$
Since $P(x)=ax^2+bx+c$,
$P(P(x))=a(ax^2+bx+c)^2+b(ax^2+bx+c)+c$
$=(a^3) x^4 + (2 a^2 b )x^3 + (2 a^2 c + a b^2 + a b)x^2 + (2abc+ + b^2 )x + (b c + c+ac^2)$
$ $
$(a^2 - b^2 + 2 a c + c^2)+ (- 2 a b + 2 b c )x+( - 2 a^2 + b^2 + 2 a c)x^2 + (2 a b) x^3 + (a^2 )x^4=(a^3) x^4 + (2 a^2 b )x^3 + (2 a^2 c + a b^2 + a b)x^2 + (2abc + b^2 )x + (b c + c+ac^2)$
Now I just have to match the $x^4$ coefficients with each other, then the $x^3$ coefficients, and so on.
$a^3=a^2$ so $a=1$
Matching the $x^2$ coefficients gives:
$2c+b^2+b=-2+b^2+2c$ so $b=-2$
Finally, evaluating the constant gives $-2c+c+c^2=1-4+2c+c^2$. Simplifying gives $c=1$
And so finally, we have our coefficients giving the polynomial $P(x)=x^2-2x+1$
Honestly, $P(x)=0$ was a better answer tho.