Congruence implies all squares of number are 1 mod 24 I am asked to show that If $n \equiv -1 \mod 24$ and a|n, then $a^2 \equiv 1 \mod 24 $
In the parts before this i am asked :
If a is an integer such that $3 \nmid a$, then $a^2 \equiv 1 \mod 3$.
If a is an odd integer, then $a^2 \equiv 1 \mod 8$. which i was able to show and may or may not be helpful.
 A: Note that $n$ is coprime to $24$, so also coprime to both $2$ and $3$, and since $a\mid n$, the same applies to $a$.
Thus as you observe, $a^2\equiv 1 \bmod 3$ and $a^2\equiv 1 \bmod 8$ and so the Chinese Remainder theorem will inevitably give $a^2\equiv 1 \bmod 24$. 
A: In this kind of questions on congruences, answers may vary in "sophistication" but at the core they usually boil down to the Chinese Remainder theorem or Bezout's theorem. Here is a quick "ring theoretic" argument. A formal algebraic expression of the CRT is the isomorphism of rings $Z/24Z \cong Z/8Z \times Z/3Z$ . Let us determine all the $x\in Z/24Z$ having square $1$. Note that necessarily $x\in (Z/24Z)^*$, the multiplicative group of invertible elements of $Z/24Z$. Writing $x=(x_1, x_2)$ in the previous decomposition, $x^2=1$ iff $(x_1^2, x_2^2)=(1,1)$ in the direct product. Since $Z/3Z$ is the field with three elements, the equation $x_2^2=1$ is automatically satisfied in $(Z/3Z)^*$. Besides, the group $(Z/8Z)^*$ is known to be the direct product of the two cyclic groups of order $2$ generated respectively by the classes of $2$ and $5$, so the equation $x_1^2=1$ is also automatically satisfied .  
Conclusion : If $a^2b^2\equiv 1 \pmod {24}$, then $a$ is obviously invertible mod $24$, so automatically $a^2\equiv 1\pmod{24}$.
