1. If $n=1$, it's easy to see that the only solution is $P(x)=x$.
2. If $n \geq 2$, set $x=0$:
$$P(0)=(-1)^n\cdot P(0)\cdot P(1)\cdot \ldots \cdot P(n-1)$$
If $P(0)$ is non-zero, we have
$$ P(1)\cdot P(2) \cdot \ldots \cdot P(n-1)=(-1)^{n+1}$$
This means that all the values $P(1), P(2), \ldots, P(n)$ are $\pm 1$. However, none of this values can be $1$, because by setting $x = 1$, we would have $P(1)=0$. This means they are all $-1$, so
$$P(x)=[x-P(0)]\cdot (x+1)^{n-1}$$
Now setting $x=1$ we get
$$-1=P(1)=2^{n-1}\cdot [1-P(0)]$$
which is false. This means we must have $P(0) = 0$. Therefore the given relation writes as
$$P(x)=x(x-P(1))(x-P(2))\cdot\ldots \cdot(x-P(n-1))$$
Now setting $x=1$ gives
$$(1-P(1))(1-P(2))\cdot \ldots \cdot(1-P(n-1))=P(1) $$
However, since $\gcd(P(1),1-P(1))=1$, we must have either $P(1)=0$ or $P(1)=2$.
If $P(1) = 0$, we have $P(i)=1$ for some $2\leq i \leq n-1$, but setting $x=i$ gives
$$1=i^2(i-1)(i-P(2))\cdot \ldots \cdot(i-P(n-1))$$
which is false again.
If $P(1) = 2$ we get
$$(1-P(2))\cdot \ldots \cdot(1-P(n-1))=-2$$
None of these factors can be $1$ (similar reasoning as previously), so $P(i)=3$ for some $i$ and $P(j)=0$, for $2\leq j \leq n,\ j\neq i$. We get $P(x)=x^{n-2}(x-2)(x-3)$, which is not a solution.
In conclusion, the only solution is $P(x) = x$.
Case $n>1$
As you noticed $P(0)=0$. Using this fact and evaluate the equality in $x=n$ you have:
\begin{gather}
nP(n-n) = (n-1)P(n)\\
0 = P(n)
\end{gather}
This procedure suggests (in some sense) the following statement:
If $k\in \mathbb N$ and $kn$ is a root of $P(x)$, then $(k+1)n$ is a root of $P$.
Infact, evaluating the eqaulity in $(k+1)n$ knowing that $P(kn)=0$ we have:
\begin{gather}
(k+1)n P((k+1)n-n)) = ((k+1)n-1)P((k+1)n)\\
0 = P((k+1)n)
\end{gather}
Thanks to this fact, you have that the set $\{0,n,2n,3n, 4n,...\} = \{kn\}_{k\in \mathbb N}$ is a set of roots of $P$. Since it is infinity, $P(x)=0$.
Case $n=1$
Again we have $P(0)=0$ so $P(x)=xQ(x)$ for a certain polynomial $Q(x)$. Sobstituting this equality in the equality of the text we have:
\begin{gather}
x(x-1)Q(x-1)=x(x-1)Q(x)\\
Q(x-1)=Q(x)
\end{gather}
And this implies that $Q(x)=c$ with $c\in \mathbb R$. Then the polynomial $P(x)$ is necessarly of the form $P(x)=cx$ for some $c\in \mathbb R$ and every polynomial of this form works.
Edit: In the case $1$ we have to take linear increment and not exponential.
Best Answer
Let $p_n = p(n)$, we then have the recurrence $$p_{n+1} = p_n + (2n+1) \implies p_{n+1} - (n+1)^2 = p_n - n^2$$ Hence, we have $$p_n = n^2 + k$$ where $k$ is some constant. Since $p(n) = n^2+k$ at all integer points and the fact that $p(n)$ is a polynomial, we have $p(x) = x^2+k$. This is because we then have $p(x)-x^2-k$ has infinitely many roots and the only polynomial having infinitely many roots is the zero polynomial. Hence, we obtain that $$p(x)=x^2+k$$