Prove that $\alpha$ is an automorphism of $Z_n$. Let $ r \in U(n)$[We define $U(n)$ to be the set of all positive integers less than $n$ and relatively prime to n].  Prove that the mapping $ \alpha : Z_n \rightarrow Z_n $ defined by $ \alpha(s)=sr$ mod $n$ for all $s$ in $Z_n$ is an automorphism of $Z_n.$   I tried proving one-one and onto and this is what I got 1)One-One
$$\begin{align*}
\alpha(s)&=\beta(s)\\
\Rightarrow sr\, mod\,n &\equiv\,pr\,mod\,n\\
\Rightarrow s&\equiv\,p\,mod\,n\,\,\,\,\,\,\,\text{(Since gcd(r,n)=1)}
\end{align*}$$
$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$Thus $\,\,\,s\,mod\,n=p\,mod\,n$ 
2)Onto$$\text{Since}\,r\text{ is a generator of }Z_n,\text{we know that }y=r^k\text{ for some }k.\\\text{Thus for every }\,y\in Z_n, \text{take}\,s=r^{k-1}.\\\text{Then }sr\,mod\,n=r^k\,mod\,n=y\,mod\,n=y.\\\Rightarrow\alpha(s)=y$$  I'm quite confident about showing the function is one-one.  Is there any element that doesn't make sense in the proof on onto?
 A: First of all I would recommend using the notation $[a]$ instead of $a$, since elements of $\mathbb{Z}_n$ are equivalence classes, not integers. Also you miss the proofs that the mapping is well-defined and that it's homomorphism. 
On the other hand your onto proof is wrong. Note that $Z_n$ is a group wrt to addition, not multiplication, so if $[r]$ is generator all elements are of the form $n[r]$, not $[r]^n$. 
Anyway here's a proof I think is supposed to be easier. First of all prove that the given mapping is well-defined But this is true as $[a] = [b] \implies [ra] = [rb] \implies \alpha([a]) = \alpha([b])$
Now prove that it's homomorphism:
$$\alpha([a]+[b]) = \alpha([a+b]) = [r(a+b)] = [ra + rb] = [ra] + [rb] = \alpha([a]) + \alpha([b])$$
To prove that it's 1-1 it's enough to prove that $\ker \alpha$ has only one element, namely the identity element. But this is true, as $\alpha([a]) = [0] \implies [ra] = [r\cdot 0] \implies [a] = [0]$, as $(n,r) = 1$
Let $[a]$ be an arbitrary element of $\mathbb{Z}_n$. Then as $(n,r) = 1$, there exist an element $[r^{-1}]$ in $\mathbb{Z}_n$, which is a multiplicative inverse of $[r]$. Now $[ar^{-1}] \in \mathbb{Z}_n$, as $\mathbb{Z}_n$ is closed under multiplication, so we have:
$$\alpha([ar^{-1}]) = [ar^{-1}r] = [a]$$
Hence $\alpha$ is onto and therefore it's an automorphism.
