First, $f= 0$ is a solution, as pointed out by Travis. Now, assume $f\neq 0$.
Let $d:=\deg(f)$, let $a_d$ be the leading coefficient. Divide both sides of the functional equation by $x^{2d}$ and let $x\to \infty$. It follows that $a_d^2=a_d$ and $a_d\neq 0$, so $a_d=1$. In other words, $f$ is monic. Now, let $f(x)=:x^d+g(x)$, then the functional equation becomes
$$
\begin{align*}
(g(x)+x^d)(g(x+1)+(x+1)^d)&=g(x^2+x)+(x^2+x)^d\\
g(x)g(x+1) + x^dg(x+1)+(x+1)^dg(x)=g(x^2+x).
\end{align*}
$$
If $g\neq 0$, the degree on the left is $d+\deg(g)$. This is strictly larger than $2\deg g$, which is the degree on the right. We conclude that $g=0$ and $f=x^d$. Indeed, this polynomial satisfies the functional equation.