[step:Count units by the standard representatives]
For each residue class $\bar{a}\in\mathbb{Z}/n\mathbb{Z}$, the [division algorithm](/theorems/725) gives unique integers $q,r\in\mathbb{Z}$ such that $a=qn+r$ and $0\le r<n$. Define $k=r$ if $1\le r\le n-1$, and define $k=n$ if $r=0$. Then $k\in\{1,\dots,n\}$ and $\bar{k}=\bar{a}$. The representative $k$ is unique in $\{1,\dots,n\}$ because if $k,\ell\in\{1,\dots,n\}$ and $\bar{k}=\bar{\ell}$, then $n\mid(k-\ell)$, while $|k-\ell|<n$, so $k-\ell=0$.
Thus the map sending a residue class to its unique representative in $\{1,\dots,n\}$ is a bijection between $\mathbb{Z}/n\mathbb{Z}$ and $\{1,\dots,n\}$. By the equivalence already proved, this bijection restricts to a bijection
\begin{align*}
(\mathbb{Z}/n\mathbb{Z})^\times \longleftrightarrow \{k\in\{1,\dots,n\}:\gcd(k,n)=1\}.
\end{align*}
Taking cardinalities and using the defining formula for $\varphi(n)$ gives
\begin{align*}
\left|(\mathbb{Z}/n\mathbb{Z})^\times\right|=\varphi(n).
\end{align*}
When $n=1$, the same argument gives the unique representative $k=1$, the quotient ring has its single element as the identity element, and the displayed cardinality is $1=\varphi(1)$. This completes the proof.
[/step]