for his correct solution, which you can find below:
If $f(x) = 0$, then $f(x^2+x+1) = 0$. This means that, if $\alpha$ is a root of $f(x)$, $\alpha^2+\alpha+1$ is also a root of $f(x)$.
If $\alpha$ is real, $\alpha < \alpha^2+\alpha+1$, and this gives an infinite ascending sequence of roots of $f(x)$. As $f(x)$ is a non-zero polynomial, this is a contradiction.
To show that the proposition is not vacuously true, we try to find examples of functions $f(x)$ that satisfy the hypothesis.
Let us write $t(x) = x^2 + x + 1$.
We note first that the set of good functions is closed under multiplication. Indeed, if $f_1(t(x)) = f_1(x)g_1(x)$ and $f_2(t(x)) = f_2(x)g_2(x)$, we have $f'(t(x)) = f'(x)g'(x)$, with $f'=f_1f_2$ and $g'=g_1g_2$. This shows that it is enough to find irreducible good functions.
By the previous argument, the iterates $t^n(\alpha)$ of any root $\alpha$ of $f(x)$ must only produce a finite set of values. We can therefore find suitable functions $f(x)$ by looking for fixed points of the iterates $t^n(x)$, or by factoring $t^n(x) - x$ for various $n$. We give a couple of examples:
For $n=1$, $t(x) - x = x^2 + 1$. This gives $f(x) = x^2 + 1$.
We compute $f(t(x))=x^4+2x^3+3x^2+2x+2=(x^2+1)(x^2+2x+2)$, giving $g(x) = (x^2+2x+2)$.
For $n=2, t(t(x)) - x = x^4+2x^3+4x^2+3x+3 = (x^2+1)(x^2+2x+3)$. Since we already have $x^2+1$, we take $f(x) = x^2+2x+3$.
We compute $f(t(x)) = x^4+2x^3+5x^2+4x+6 = (x^2+2x+3)(x^2+2)$, giving $g(x) = x^2 + 2$.