I'm to show that all automorphisms $\phi:\mathbb{Z}_n\to \mathbb{Z}_n$ are of the form $\phi(m) = km$,
where $k\in \mathbb{Z}_n$ and the greatest common divisor of n and k, $gcd(k,n) = 1$.
I was thinking that I could show that if $\phi(m) = km$, wasn't on the specified form, then it wouldn't be an automorphism on $\mathbb{Z}_n$.
First of all I'm uncertain as to whether I have to prove that all homomorphisms $\psi: \mathbb{Z}_n \to \mathbb{Z}_n$ are of the form $\psi(m) = km$ where $k\in \mathbb{Z}_n$.
But then I thought: if I show that $\phi:\mathbb{Z}_n\to\mathbb{Z}_n$ is on the form $\phi(m) = km$, where $gcd(k,n) \neq 1$ (no need to show that $k\in \mathbb{Z}_n$, since $\forall k\in \mathbb{Z} \to k \in \mathbb{Z}_n$), then $\phi$ isn't bijective and hence isn't an automorphism, have I then shown the original claim?
Let $k=\psi(1)$. Then, for each $m\in\mathbb{Z}_n$,\begin{align}\psi(m)&=\psi(\overbrace{1+1+\cdots+1}^{m\text{ times}})\\&=\overbrace{k+k+\cdots+k}^{m\text{ times}}\\&=km.\end{align}So, yes, every endomorphism of $\mathbb{Z}_n$ has this form and your approach is correct: now all you need to prove is that $\psi$ is an automorphism if and only if $\gcd(k,n)=1$.