Prove if $5 \nmid n$, then $n^2 = 5k \pm 1$ I am having difficulty finishing this proof. At first, the proof is easy enough. Here's what I have thus far:
Because $5 \nmid n$, we know $\exists q \in \mathbb{Z}$ such that $$n = 5q + r$$ where $0 < r < 4$. Note $r \neq 0$ because if $r = 0$, then $5 \mid n$. Also note that $n^2 = 25q^2 + 10qr + r^2$. Then we have four cases: when $r=1$, $r=2$, $r = 3$, and $r = 4$. This is where I run into difficulty. In each of these cases, we can prove that either $n^2 = 5k + 1$ or $n^2 = 5k - 1$ for some integer $k$, but I cannot see how to prove both for each case. Any ideas?  
As a side note on how I went to prove each case, I simply plugged $r$ into the formula $n^2 = 25q^2 + 10qr + r^2$. This results in $n^2 = 25q^2 + 10q + 1$. 
Continuing, we get $n^2 = 5(5q^2 + 2q) + 1$, and because $5q^2 + 2q$ is still an integer, this is of the form $n^2 = 5k + 1$ for some integer $k$. But I cannot find how to make the 1 a negative to prove both cases.

Just do it.
$n^2 = 25q^2 + 10qr + r^2 = 5(5q^2 + 2qr) + r^2$.
ANd $r^2 = 1,4=5-1, 9 =10-1$ or $16=15+1$.
So if $n = 5q + 1$ then $n^2 = 5(5q^2 + 2q) + 1$
If $n=5q+2$ then $n^2 = 5(5q^2 + 4q)+4 = 5(5q^2+4q + 1) -1$
If $n = 5q+3$ then $n^2= 5(5q^2 + 6q) + 9 = 5(5q^2 + 6q + 2) -1$
And if $n = 5q+4$ then $n^2 = 5(q^2 + 8q) + 16=5(5q^2 + 8q + 3) + 1$.
That's it.
