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??
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$.