Why (Zn,*), integers modulo n under multiplication, is a group if and only if n is prime?
Is it true that $(\Bbb Z_n,\cdot)$, integers modulo $n$ under multiplication, is a group if and only if $n$ is prime? If it's true, why? How can I prove it?
$\endgroup$ 41 Answer
$\begingroup$Note that $\mathbb{Z}_n=\mathbb{Z}/n\mathbb{Z}$ is never a group with respect to multiplication, unless $n=1$.
This is because $[0]$ is not invertible, whenever $n>1$. Note: I denote by $[x]$ the equivalence class of $x\in\mathbb{Z}$ under congruence modulo $n$.
If we instead consider $\mathbb{Z}_n\setminus\{[0]\}$ under multiplication, then the set is empty for $n=1$ and it is not even a semigroup for composite $n>1$; indeed, if $n=ab$, with $1<a<n$ and $1<b<n$, we have $$ [a][b]=[ab]=[n]=[0] $$ so the set is not closed under multiplication.
Only primes then remain for investigation. If $n$ is prime and $[a]\ne[0]$, then $p\nmid a$ and so $\gcd(a,p)=1$. Therefore the Bachet-Bézout theorem provides $b$ and $c$ such that $ab+pc=1$ and we found the multiplicative inverse $[b]$ of $[a]$.
Remark that this also proves that, for $[x],[y]\ne[0]$, the product $[x][y]\ne[0]$, so the set is closed under multiplication.
$\endgroup$