Prove that an exact sequence splits Let $0 \to r\mathbb{Z}_n \to \mathbb{Z}_n \to s\mathbb{Z}_n \to 0$ where n =rs an exact sequence of $\mathbb Z$ modules the how can I prove the sequence splits if and only if $(r,s)=1$
The only thing I can show is 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*}
and 
\begin{align*}
\operatorname{im}  f
&= \{sx+n\Bbb Z:x\in\Bbb Z\} \\
&= s\Bbb Z_n
\end{align*}
Dont know if this can be helpful to prove the statement??
 A: Remember that if $0 \to A \to B \to C \to 0$ is a split exact sequence of modules, then $B \cong A \oplus C$. Suppose $(r,s)>1$. (Note that $r\Bbb Z_n \cong \Bbb Z_s$ and vice versa.) Show that $\Bbb Z_n \not\cong \Bbb Z_r \oplus \Bbb Z_s$.
In the other direction, you should be able to write down an explicit section $s \Bbb Z_n \to \Bbb Z_n$.
A: Let $A=\Bbb Z_n$. I suppose the morphisms are the inclusion and multiplication by $s$. If $n=rs$, then multiplication by $r$ induces an isomorphism, $rA\simeq \Bbb Z_s$. Similarly, multiplication by $s$ induces an isomorphism $sA\simeq \Bbb Z_r$.  
What you have is a SES
$$0\longrightarrow rA\longrightarrow  A\longrightarrow  sA\longrightarrow  0$$
If we have an equation $rq+sp=1$, then consider the map $A\to rA$ defined as follows. Every $x\in A$ may be decomposed into $x=rqx+spx$, define $x\mapsto rqx$. To show this is well defined, suppose $rqx+spx=rq'x+sp'x$. Then $rqx-rq'x=sp'x-spx$ and since $rA$ kills everything modulo $s$, $rqx$ and $rq'x$ represent the same class. It should be clear this is  $\Bbb Z$-linear. Now let $\mu:rA\to A$ be the inclusion. Then for $rx\in A$, our map sends $rx=r1x+s0y$ to $rx$, and the inclusion sends it back to $rx$. This means our map is a section, and the splitting lemma gives the result. 
