Help proving a short exact sequence 
Show the following sequence is an exact sequence of $\mathbb Z$-modules when $n$ is a positive integer such that $n=rs$:
  $$ 0 \to r\mathbb{Z}_n \to \mathbb{Z}_n \to s\mathbb{Z}_n \to 0. $$

should i attack this problem using the statement tha a short sequence is exact if and only if  $$ Ker(f)=Im(g) $$ which function should i consider for $f$ and $g$ ?  
 A: You are given the sequence
$$
0\to r\Bbb Z_n\xrightarrow{g}\Bbb Z_n\xrightarrow{f} s\Bbb Z_n\to 0\tag{1}
$$
where $n=rs$, $g(rx+n\Bbb Z)=rx+n\Bbb Z$, and $f(x+n\Bbb Z)=sx+n\Bbb Z$. 
Note that
\begin{align*}
\DeclareMathOperator{im}{im}\im g
&= \{rx+n\Bbb Z:x\in\Bbb Z\} \\
&= \{x+n\Bbb Z:r\mid x\}
\end{align*}
Furthermore
\begin{align*}
\ker f
&= \{x+n\Bbb Z:\exists \ell\in\Bbb Z, sx=\ell n\} \\
&= \{x+n\Bbb Z:\exists\ell\in\Bbb Z,sx=\ell rs\} \\
&= \{x+n\Bbb Z:\exists\ell\in\Bbb Z,x=\ell r\} \\
&= \{x+n\Bbb Z:r\mid x\}
\end{align*}
Hence $\ker f=\im g$. 
To see that $g$ is injective, note that
\begin{align*}
\ker g
&= \{rx+n\Bbb Z:\exists\ell\in\Bbb Z,rx=n\ell\} \\
&= \{rx+n\Bbb Z:\exists\ell\in\Bbb Z,rx=rs\ell\} \\
&= \{rx+n\Bbb Z:\exists\ell\in\Bbb Z,x=s\ell\} \\
&= \{rs\ell+n\Bbb Z:\ell\in\Bbb Z\} \\
&= \{n\ell+n\Bbb Z:\ell\in\Bbb Z\} \\
&\simeq 0
\end{align*}
To see that $f$ is surjective note that
\begin{align*}
\im f
&= \{sx+n\Bbb Z:x\in\Bbb Z\} \\
&= s\Bbb Z_n
\end{align*}
This proves that (1) is exact.
A: Let $f:rZ_n\to Z_n$ and $g:Z_n\to sZ_n$
Take $f$ as a identity map and $g(x)=sx$ then you can easily see that $Image(f)=ker(g)$ and $g$ is onto.
