TITLE: Group theory proof of Euler's theorem ($a^{\phi(m)} \equiv 1\mbox{ }(\mbox{mod }m)$ if $\gcd(a,m)=1$)
QUESTION [6 upvotes]: From A Classical Introduction to Modern Number Theory by Ireland and Rosen, page 33:

Corollary 1 (Euler's Theorem). If $(a,m) = 1$, then $a^{\phi(m)} \equiv 1\,(m)$.
Proof. The units in $\mathbb{Z}/m\mathbb{Z}$ form a group of order $\phi(m)$. If $(a,m) = 1$, $\bar{a}$ is a unit. Thus $\bar{a}^{\phi(m)} = \bar{1}$ or $a^{\phi(m)} \equiv 1\,(m)$.

If I'm interpreting this correctly, this proof implicitly uses the fact(?) that if $G$ is a group and $x\in G$, then $x^{|G|}=1$, where $1$ is the identity element of $G$.
If this is indeed true, can someone explain why? (I have had no prior exposure to group theory.)

REPLY [2 votes]: Lagrange says that the order of a subgroup divides the order of the (finite) group.
Now take any element $g$, then it generates a cyclic subgroup $\langle g \rangle$. Its order is the smallest $n$ such that $g^n = e$.
Since $n$ divides $|G|$ we must then have that $g^{|G|} = e$.