Let $f:\mathbb R\to \mathbb R$, $x\in\mathbb R$ and
$$f(x^2 + 3x + 1) = f^2(x) + 3f(x) + 1.$$
Prove that $f(x)=x$ has a solution $\in \mathbb R.$
Let $f:\mathbb R\to \mathbb R$, $x\in\mathbb R$ and
$$f(x^2 + 3x + 1) = f^2(x) + 3f(x) + 1.$$
Prove that $f(x)=x$ has a solution $\in \mathbb R.$
Hint: Let $y$ be a solution to $x=x^2+3x+1$, then you get a quadratic equation in $f(y)$ which you can solve for $f(y)$.