Prove that that $U(n)$ is an abelian group. Prove that that $U(n)$, which is the set of all numbers relatively prime to $n$ that are greater than or equal to one or less than or equal to $n-1$ is an Abelian group.
My thought process: for $a, b \in U(n)$
Associativity:  $(a + b) + c = a + (b + c)$
Identity: $1$ is in the set so $a\cdot 1 = a = 1\cdot a$
Inverse: I'm stuck on how to determine the inverse of the set if it exist.
Abelian criteria : $a\cdot b = b\cdot a$
Thanks
 A: It’s true that you know that multiplication in $\Bbb Z$ is associative and commutative, but you still have to prove that multiplication in $U(n)$ is associative and commutative, i.e., that multiplication modulo $n$ is associative and commutative. To show that every element of $U(n)$ has a multiplicative inverse in $U(n)$, use Bézout’s lemma: if $a$ and $n$ are relatively prime, there are integers $u$ and $v$ such that $au+vn=1$.
A: Let $ a \in Un$ then we have to show that there exists $b \in Un$ such that $a.b$  mod $n = 1$.
Let us suppose $o(a)=p \implies a^p = e $ 
Now if $b$ is inverse of $a$ then $a.b$  mod $n = 1$ holds i.e. $ a.b = x(n) +1 $ for some $ x $ (By division algorithm)
Now multiply $a^{p-1}$ 
We get $ b = xa^{p-1}n + a^{p-1}$ 
Check if this $b$ we choose is inverse of $a$ i.e. show that $ a(xa^{p-1}n + a^{p-1})$ mod $ n = 1$ 
$ a(xa^{p-1}n + a^{p-1})$ mod $ n = (xa^p n + a^p )$ mod $n$ 
$ = (xn + 1)$ mod $n$ (as $a^p =1$) 
$(xn)$ mod $n + 1$ mod $n = 0 + 1 = 1$ 
Hence $b$ is the inverse of $a$. But we are not done yet, we must show that this $ b = xa^{p-1}n + a^{p-1}$ also belongs to $Un$ i.e. $Gcd(xa^{p-1}n + a^{p-1}, n) =1$ 
Let us suppose $b \notin Un$ 
$ \implies Gcd(xa^{p-1}n + a^{p-1}, n) = s$ for some $ s \geq 1$ 
$ \implies s$ divides $xa^{p-1}n + a^{p-1}$ as well as $n$ 
$ \implies (xa^{p-1}n + a^{p-1})$ mod $s = 0$ 
$ (xa^{p-1}n)$ mod $s + a^{p-1}$ mod $s =0$ 
But we know that $a^{p-1} \in Un \implies Gcd(a^{p-1},n) =1$ i.e. there does not exist any $s$ such that $s$ divides $n$ as well as $a^{p-1}$ 
$ \implies a^{p-1}$ mod $s \neq 0$ 
Also as $s$ divides $n \implies n = rs$ for some $r$ 
$\implies (xa^{p-1}rs)$ mod $s = 0$ but  $a^{p-1}$ mod $s  \neq 0$ 
Hence their sum is also non zero which is a contradiction
$ \blacksquare$
A: Let $k\in U(n)$, thus $gcd(k,n)=1$ and so there exist integers $x,y$ such that $xk+yn=1$. Taken modulo $n$ this equation becomes $xk=1$ and so, modulo $n$, the inverse of $k$ is $x$. 
Also, note that the group operation is multiplication and not addition. Proving the other abelian group axioms is easy. 
A: The associative law and the fact that $U(n)$ is abelian follows from those properties in the commutative ring $\mathbb Z_n$. Since 1 is trivially relatively prime to $n$, $U(n)$ has an identity element. We proceed to show the existence of inverses:
Let $a$ be relatively prime to $n$ and define the map $f:U(n)\to U(n)$ by $f(x)=ax$; the function actually maps into $U(n)$, since if $(x,n)=1$, then $(ax,n)=(a,n)(x,n)=1$. 
I claim $f$ is injective. For, $f(x)=f(y)$ implies $ax\equiv ay$ and so $a(x-y)\equiv 0\pmod n$. Therefore, $x\equiv y$, since $n$ shares no factors with $a$. Thus, $f$ is injective as desired. The finite domain of $f$ is the same as its codomain, so $f$ also is surjective, mapping some $x_0$ to $1$. I.e. $f(x_0)=ax_0=1$.
