Show that if $p$ is an odd prime and $a \in \mathbb Z$ such that $p$ doesn't divide $a$ then $x^2\equiv a(mod p)$ has no solutions or exactly 2 incongruent solutions.
The only theorem that I thought could help was:
Let $a, b$ and $m$ be integers with $m > 0$ and $gcd(a,m)=d$. If $ d $ doesn't divides $b$ then $ax\equiv b(mod p)$ has no solutions. If $d$ divides $b$ then $ax\equiv b(mod p)$ has exactly $d$ incongruent solutions modulo $m$.
But I feel that this would be an invalid theorem for this proof since $ax$ and $x^2$ are of different degrees.
Thoughts? Other methods to approach this?