TITLE: If n is such that every element $(\mathbb{Z}/n\mathbb{Z})^{\times}$ is a root of $x^2-1$. Prove that $n$ divides 24.
QUESTION [7 upvotes]: I have a hard time formulating proofs.  For this problem, I  can see that if $n$ is equal to $8,$ this statement is true.  $(\mathbb{Z}/8\mathbb{Z})^{\times}$ includes elements:  $1,3,5,7$, and all of these are roots of $1-x^2 \pmod 8.$  And obviously $8$ divides $24.$
But how do I prove this without depending on number calculations and only using theorems?  Help Please?  I need a step by step walk through of how to do this proof and what theorems would be appropriate to use.

REPLY [2 votes]: $\,\overbrace{{\rm if}\,\ 5\!\nmid\! n\,\ {\rm then}\,\ n\,|\, \color{#90f}{24}\!=\! 5^2\!-\!1}^{\large \text{by hypothesis}},\,$ else $\,5\!\mid\! n =\!\! \overbrace{\color{#0a0}2^{\large j}\color{#c00}k}^{\large {\rm odd}\  \color{#c00}k}\!, \,$ &  $\,(\color{#0a0}2\!+\!5\color{#c00}k)^{\large 2}\!\not\equiv 1\bmod{5},\,$ so  $\not\equiv 1\bmod n.\, $ $\small\bf QED$