Suppose $d_1d_2=n$ and let $0 \to d_1\mathbb Z_n \overset {i} \to \mathbb Z_n \stackrel {d_2\cdot} \to d_2\mathbb Z_n\to 0$ be a short exact sequence. Show that sequence splits iff $\gcd(d_1,d_2)=1$.
Suppose s.e.s. split then $\mathbb Z_n=d_1\mathbb Z_n +d_2\mathbb Z_n$, hence $1=d_1a+d_2b$ hence $\gcd=1$. How to prove the converse?
If $(d_1,d_2)=1$, show that every $a \in \mathbb Z_n$ can be written as $a=xd_1+yd_2$ where $x,y\in \mathbb Z_n$ are unique modulo $d_2$ and $d_1$ respectively.
Then define $f:\mathbb Z_n \to d_1\mathbb Z_n$ by $f(xd_1+yd_2)=xd_1$. This is well defined since $x$ is unique modulo $d_2$ and $d_1d_2=n=0$. Show that is a group homomorphism and that $fi=\text{Id}_{d_1\mathbb Z_n}$.