What is wrong with this "proof"?
If the sequence of $\Bbb{Z}$-modules $$0\to M \to N \to \Bbb{Z}/2 \to 0$$ is exact, then $N\cong M \oplus \Bbb{Z}/2$.
Call the first map $f$, the second $g$. By exactness, we have $$\begin{aligned} \Bbb{Z}/2 &= \operatorname{Im} g\\ \ker g &= \operatorname{Im} f \\ \ker f &= 0. \end{aligned}$$
By the first isomorphism theorem, we have $$\Bbb{Z}/2 \cong N / \ker g = N/\operatorname{Im} f\\ \operatorname{Im} f \cong M/ \ker f = M.$$
So $\Bbb{Z}/2 \cong N/M$, i.e. $N \cong M \oplus \Bbb{Z}/2$.
The exact sequence may not be split. $N/M\cong\mathbb{Z}_2$ does not imply that $N\cong M\oplus\mathbb{Z}_2$. A counterexample is $N\cong M\cong\mathbb{Z}$ and $M\to N$ is the multiplication by 2 map.