Proof of Euler's Totient Theorem? The following is given as a proof of Euler's Totient Theorem:

$(\mathbb{Z}/n)^\times$ is a group, where Lagrange theorem can be
applied. Therefore, if $a$ and $n$ are coprime (which is needed),
then $a$ is invertible in the ring $\mathbb{Z}/n$, i.e. :
$$a^{\#(\mathbb{Z}/n)^\times}=a^{\varphi(n)}=1.$$

Could someone please explain this? It doesn't seem obvious to me that this holds true. How exactly is ${\#(\mathbb{Z}/n)^\times}$ = $\varphi(n)$?
 A: The thing is that $\#\{(\mathbb Z / n)^{\times}\}= \varphi(n)$ the every element in this group will have an order which it divides $\#\{(\mathbb Z / n)^{\times}\}$, then we have $a^{\#\{(\mathbb Z / n)^{\times}\}}=1$ for every $a\in (\mathbb Z / n)^{\times}$ (this comes from Lagrange theorem).
The equality that bothers you $\#\{(\mathbb Z / n)^{\times}\}= \varphi(n)$ is called Bezout's Theorem, I'll prove it here anyways.
For $a\in \{1,\dots ,n \}$ to be invertible in $\mathbb{Z}/n$ you need that there most be an element $b\in \{1,\dots ,n \}$ such that $ab\equiv 1 ({\rm mod }\,1)$, then there must be $k\in\mathbb Z$ such that
$$ ab=1+kn\,\,\,\,\,\,\,\,{\rm or}\,\,\,\,\,\,\,\,ab-kn=1$$
Then $a$ is coprime with $n$ and we have that $\#\{(\mathbb Z / n)^{\times}\}\leq\varphi(n)$.
Conversely, if $a\in\{1,\dots ,n \}$ is coprime with $n$ there must be $x,y\in\mathbb Z$ such that
$$ax+ny=1 \,\,\,\,\,\,\,\,{\rm or}\,\,\,\,\,\,\,\,ax=1-ny$$
or in other words $a\in(\mathbb Z/n)^{\times}$ then $\varphi(n)\leq\#\{(\mathbb Z / n)^{\times}\}$. Finally $\varphi(n)=\#\{(\mathbb Z / n)^{\times}\}$.
A: $\Bbb Z_n^\times$ is precisely the elements which are relatively prime to $n$.  For, by Bezout's identity, only those are invertible mod $n$.
A: An integer $a\in\mathbb{Z}$ is invertible in $\mathbb{Z}/n$ if and only if $a$ and $n$ are coprime.  This follows immediately from Bezout.  So $\#(\mathbb{Z}/n)^\times$ is precisely the number of integers between $1$ and $n$ (inclusive) which is coprime to $n$, that is $\varphi(n)$.
