TITLE: How can I show $e^2 \equiv 1 \bmod 24$, given that $\gcd(e, 24) = 1$?
QUESTION [6 upvotes]: The problem comes from a practice final for a final exam I have later today.
It says "Show that if $\gcd(e, 24) = 1$ then $e^2 \equiv 1 \bmod 24$".
I found that Euler's totient function $\phi(24) = 8$ So I now know $e^8 \equiv 1 \bmod 24$, but I'm not sure where to go from there.
I found that if $\sqrt[4]e$ is an integer, then it's obvious that $\sqrt[4]e \mid e$, so $\gcd(\sqrt[4]e, 24) = 1$ which I can use to prove $e^2 \equiv 1 \bmod 24$, but that only proves it in the case where $\sqrt[4]e$ is an integer (and I don't think I'm really going in the right direction here).

REPLY [3 votes]: Say $gcd(e, 24) = 1$.  Since $24 = 2^3 \times 3$, we know $e$ is not even and not a multiple of 3. So $e$ is of form $6k \pm 1$, for some integer $k$.
Then 
$$(6k \pm 1)^2 = 36k^2 \pm 12k + 1$$
and so it suffices to show that $36k^2 + 12k$ is a multiple of $24$. We can factor it as $12k(3k+1)$; for any choice of $k$, one of $k$ and $3k+1$ is even, so $k(3k+1)$ is even, and $12k(3k+1)$ is a multiple of 24.