Let $p$ be a prime number, $p \geq 3$. Show that there exists a unique value of $p$ such that the polynomial $X^2 + X +1 $ is equal to $(aX^2 + b)^2$ for some values of $a,b$ in $\mathbb{F}_p$.
My attempt: we have $X^2 + X + 1 = a^2 X + 2ab X + b^2$, that means that $a^2 = 1, 2ab = 1, b^2 = 1$. And as we are working in $\mathbb{F}_p$, we can deduce that $$ a^2 \equiv 1 [p] , 2ab \equiv 1 [p], b^2 \equiv 1 [p]$$ Thus, $p \nmid a,b$, and so we have by the Fermat's theorem: $$a^{p-1}\equiv 1[p] $$ and $$b^{p-1}\equiv 1[p] $$ Thus $p = 3$.
Is my reasoning correct?