I want to prove whether the following is true using congruencies: If $n$ is odd and $3\not | n$, then $n^2\equiv 1\pmod{24}$. I tried a direct proof.
Let $n=2k+1$ for an integer $k$ such that $3\not| n$, or $3c=n+r$ such that $r=1$ or $r=2$ for an integer $c$. Then in the first case, $3c=n+1$ implies $n\equiv 1\pmod 3$. Or in the second case, $3c=n+2$ implies $n\equiv 2 \pmod 3$. Then $$n^2\equiv 1 \pmod 3 \text{ or } n^2\equiv 4 \pmod 3$$ iff $$3|{n^2-1} \text{ or } 3|n^2-4$$ or $$8n^2\equiv8, 32 \pmod{24}$$ This was the farthest I got. I'm having a hard time going from mod 3 to mod 24 just given the conjunction that $n$ is odd and that $3\not| n$