The proof that the automorphism group of $Z_n$ is isomorphic to $(\mathbb Z/n\mathbb Z)^\times$ in Dummit and Foote uses the fact that if $\varphi \in \operatorname{Aut}(Z_n)$ then $\varphi(x) = x^a$ for some integer $a \in \mathbb Z$.
I can understand that this is the case because the isomorphism must send generators to generators. It seems (intuitively) that any other mapping of generators to generators won't preserve the group structure. But I don't feel comfortable with this rigorously yet; is there a proof for why any automorphism must be of the form $\varphi(x) = x^a$?
Well, since $\Bbb Z_n$ is cyclic, we can take $g$ to be a generator. Then any homomorphism is determined by where you send $g$ (because it generates). And any $y\in \Bbb Z_n$ is of the form $g^a$ for some $a$ (again because $g$ is a generator).
When the dust clears, the rule will just be $x\to x^a.$