Theorem:
For every $n>1$,
$\textrm{Aut}(\mathbb{Z}_{n}) \cong \textrm{U}_n.$
The proof begins with the consideration:
If $\textrm{gcd}(n, k) = 1$ then $\phi_{k}:\mathbb{Z}_{n}\rightarrow \mathbb{Z}_{n}$
$m \mapsto mk \pmod n$ is an automorphism of $\textrm{U}_n$.
I'm a bit lost as to why the map is defined in such a way. That is, from $m$ to $m \cdot k \pmod n$.
Could someone shed some light?
An automorphism of $\mathbb{Z}_n$ is determined by its image on $1$. So define $\phi_k : \mathbb{Z}_n \to \mathbb{Z}_n$ by $\phi_k(1) = k$. This map is an automorphism if and only if $\gcd(n,k) = 1$. To see this, note that $\phi_k$ is an automorphism if and only if $\left<k\right> = \mathbb{Z}_n$, i.e. $k$ has order $n$ in $\mathbb{Z}_n$. Since the order of an element $a$ in $\mathbb{Z}_n$ is given by $n/\gcd(a,n)$, this happens if and only if $\gcd(n,k) = 1$.