Q: Show that if $p$ prime divides $n^2-5$, then $p\equiv\pm1$(mod 5), with $p\neq2,5$
I have shown that the only common quadratic residues between $p$ and $5$ are $1$ and $4$. I note that $4\equiv-1$(mod 5). I'm not quite sure where to go from here, I'm quite lost.
Note that $p\mid n^2-5$ implies that $n^2\equiv 5\mod{p}$, so that $5$ is a square modulo $p$. Can you finish from here? (Hint: Quadratic reciprocity.)