Let n be an odd integer that isn't divisible by 3. Then $\displaystyle n^2 \equiv 1$ mod 24.

So I have n = 3x+1 and n = 3x+2.

So 24 | $\displaystyle n^2-1$.

I'm stuck after this. Should I do the X and get n odd and then do the n^2 or?....

EDIT: I figured out that if I can get n^2 - 1 mod 3 and n^2 - 1 mod 8 then X is a divisor of n^2-1 where X is the least common multiple of 3 and 8. So then that would be 24. So I just need the mod 3 and mod 8 but I can't get them quite right.