This problem is from a past qualifying exam.
Definition A group $G$ has exponent $e$ if $g^e=1$ for all $g\in G$.
Problem
Let $G=\left(\mathbb{Z}/n\mathbb{Z}\right)^\times$. Find all the integers $n$ for which $G$ has exponent $2$.
My work so far: Need to find $n$ such that $\overline{b}^2=\overline 1$ for $\overline{b} \in G$. So I need to find $n$ such that $n \mid (b^2-1)$ and $(b,n)=1$. Well, how do I now go about finding all the $n$'s. I tried a few examples like $n=1$ etc. But then I still have to deal with $b$. This kind of problem is new to me. Can somebody kindly show me what I've done wrong/right here?
May be suggest a way to go about finding these $n$'s.
Thank for your help.