Prove that if $a$ is odd, then $a^2\equiv 1\pmod 8$ Prove that if $a$  is odd, then $a^2\equiv 1\pmod 8$I got this question in my discrete mathematics class, can anyone help me?Thanks.

The clever way to do it is:
$a$ odd $\implies a -1$ and $a+1$ are two consecutive even numbers.  As they are consecutive one of them is divisible by $4$ and the other is divisible by $2$.  We have no way of knowing which is which but it doesn't matter.  One is divisible by $2$ and the other is divisible by $4$ and multiplied together $(a-1)(a+1)$ is divisible by $8$.
So $(a-1)(a+1) \equiv 0 \mod 8$
So $a^2 -1 \equiv 0 \mod 8$ 
So $a^2 \equiv 1 \mod 8$.
=====
The brute force way is easier.
$a$ is odd means $a \equiv 1, 3, 5, \text{ or } 7 \mod 8$ so 
$a^2 \equiv 1,9, 25, \text{ or } 49 \mod 8 \equiv 1 \mod 8$.
===
An intermediary method might by to realize $a = 2k + 1$ so $a^2 = 4k^2 + 4k + 1 = 4(k^2 + k) + 1$.
If $k$ is odd then $k^2$ is odd and $k^2 + k$ is even.
If $k$ is even then $k^2$ is even and $k^2 + k$ is even.
So $k^2 + k$ is divisible by $2$.
So $4(k^2 + k)$ is divisible by $8$.
So $4(k^2 + k)  \equiv 0 \mod 8$
so $a^2 = 4(k^2 + k) + 1 \equiv 1 \mod 8$.
