Let $n \in \mathbb{N}$ such that $n =rs$. Show that the follow short exact sequence
$$0 \to r \mathbb{Z}_n \stackrel{f}{\to} \mathbb{Z}_n \stackrel{g}{\to} s\mathbb{Z}_n \to 0,$$
splits iff $r$ and $s$ are coprimes.
I have no Idea how to start the first side, for the otherwise if I assume that $r$ and $s$ are coprimes, then there exists $x,y \in \mathbb{Z}$ s.t $rx + sy = 1$, well I'm stuck here.
Maybe I should define some $\phi: \mathbb{Z}_n \to r\mathbb{Z}_n \oplus s \mathbb{Z}_n$ given by $\phi([a]_n) = [a]_r+[a]_s$, but I don't know if it is well defined and a isomorphism, I guess it is related with chinese remainder theorem...
Can you help me???
I will assume that $f$ is the inclusion and that $g$ is left-multiplication by $s$. Also, write the coset of every $a \in \mathbb Z$ in $\mathbb Z_n$ as $\bar a$.
Suppose that $r$ and $s$ are coprimes, so there are integers $x$ and $y$ such that $1 = rx+sy$. Note then that if we multiply both sides of this equation by $r$ we get that $r^2x \equiv r \!\pmod{\!\!n}$. Then, if $p : \mathbb Z_n \to r \mathbb Z_n$ is left-multiplication by $rx$, we have $p \circ f = \operatorname{id}_{r \mathbb Z_n}$ and the sequence splits.
Now assume that the sequence splits, so there is homomorphism $p : \mathbb Z_n \to r\mathbb Z_n$ such that $p \circ f = \operatorname{id}_{r \mathbb Z_n}$. Note then that, if $x$ is an integer such that $p(\bar 1) = r \bar x$, $$r\bar1 = p(f(r\bar1)) = p(r\bar1) = rp(\bar 1) = r^2 \bar x$$ so $r \equiv r^2x \!\pmod{\!\!n}$ and then there is an integer $y$ such that $r = r^2x + ny$. That means $1 = rx+sy$, and then $r$ and $s$ are coprimes.