Solve $x^2+x+1\equiv0\pmod5$ 
Solve:
$$x^2+x+1\equiv0\pmod5$$

My attempt:
Our proffesor told us that if we have $ax^2+bx+c\equiv\pmod p$ we need to multiply by $4a$, to get form of $(\text{ something})^2\equiv D\pmod p$.
$p$ is a prime and $\gcd(4a,p)=1$, so I tried to do that here:
$$4x^2+4x+4\equiv 0 \pmod 5$$
But now
$$(2x+1)^2+3\equiv 0 \pmod 5$$
$$(2x+1)^2\equiv -3 \pmod 5$$
 A: For any integer $a,$
$$a\equiv0,\pm1,\pm2\pmod5\implies a^2\equiv0,1,4\pmod5\not\equiv-3$$
A: The usual formula $$x = \frac{-1\pm \sqrt{1^2 - 4\cdot 1 \cdot 1}}{2}$$ still works for integers modulo a prime, you just have to interpret the square root and the division differently. And in this case $\sqrt{-3}$ doesn't exist in the integers modulo $5$, so there are no roots.
A: More generally, there's this trick for solving quadratic congruences: if $\gcd(n,2a)=1$, then:
$$ax^2+bx+c\equiv 0\pmod{n}$$
$$\stackrel{\cdot 4a}\iff (2ax+b)^2\equiv b^2-4ac\pmod{n}$$
In this case,
$$x^2+x+1\equiv 0\pmod{5}$$
$$\stackrel{\cdot 4}\iff (2x+1)^2\equiv -3\equiv 2\pmod{5},$$
contradiction, because $2$ is not a quadratic residue mod $5$ (to see this, notice $(5k\pm 1)^2\equiv 1\pmod{5}$, $(5k\pm 2)^2\equiv 4\pmod{5}$, $(5k)^2\equiv 0\pmod{5}$).
A: In this specific case, there is yet another way:
Since $(x-1)(x^2+x+1)=x^3-1,$ we find that a solution to the equation must also satisfy $x^3-1\equiv0\pmod5.$
But if $x^3\equiv1\pmod5,$ then clearly $x^4\equiv x\pmod5.$ Also, Fermat's little theorem says that $x^4\equiv1\pmod5$ if $5\not\mid x.$ Thus the solution is either $x\equiv0\pmod5$ or $x\equiv x^4\equiv1\pmod5,$ while these two cases can easily be seen not to satisfy the equation in question. Therefore there are no solutions.  
Hope this helps.
