If $f:M\to N$ is a morphism of $A$-modules, counter-example to $M\cong \operatorname{ker}f\oplus \operatorname{im}f$

Solution 1:

Look at the $\Bbb{Z}$-modules $\Bbb{Z}/2\Bbb{Z}$ and $\Bbb{Z}/4\Bbb{Z}$. Then $\phi:\Bbb{Z}/4\Bbb{Z}\to\Bbb{Z}/2\Bbb{Z}$ defined by $\phi(a)=a\mod 2$ is a $\Bbb{Z}$ module homomorphism but the direct sum of the kernel and image is not isomorphic to $\Bbb{Z}/4\Bbb{Z}$.

Solution 2:

The simplest counter-example I can think of is $$0\to 2\mathbb{Z} \to \mathbb{Z} \to \mathbb{Z}/2\mathbb{Z} \to 0.$$ $\mathbb{Z}$ is not isomorphic to $2\mathbb{Z} \oplus \mathbb{Z}/2\mathbb{Z}$, as $\mathbb{Z}$ does not have torsion.