This is a problem that came up on my recent exam and have not been able to solve:
Let $p$ be an odd prime and $a \in \mathbb{Z}$ with $p \nmid a$. Show that if $x^2 \equiv a$ (mod $p$) has a solution, then it has exactly two solutions.
After doing some independent research of my own, I found out that this question is related to the topic of quadratic residues and this topic was not covered during lecture prior to being tested. In any case, to approach this question, I would begin by letting $s$ be a solution and then show from there that there exists exactly two. Thus, we have
$s^2 \equiv a$ (mod $p$)
Additionally, we can say that $-s$ is also another solution since when we square this term, we get $s^2$ on the LHS of the congruence. So, if this is the case, then
If $s \equiv -s$ (mod $p$) $\implies$ $2s \equiv 0$ (mod $p$). Then, $p | s$ since $p$ is an odd prime...
Where do I go from here? Im assuming we would get a contradiction of some sort, but don't know how to proceed any further.