Let $p > 3$ be a prime number. Show that the quadratic congruence $x^2+x+1≡0 \mod p$ has an integer solution if and only if $-3$ is a quadratic residue modulo p.
I think the way the question wants us to go is to show that since $p=n(x^2+x+1)$ and since $p$ is prime we can take $n=1$, therefore $p=x^2+x+1$. Then I'm guessing we show that p is prime if and only if $-3$ is a quadratic residue modulo p but I have no idea how to do that.
Since $p\ne 2$ we have $$p\mid x^2+x+1 \Longleftrightarrow p\mid 4x^2+4x+4\Longleftrightarrow p\mid (2x+1)^2+3$$
so $$ (2x+1)^2\equiv -3 \pmod p$$