From this problem here, it says that any counter example can not be finitely generated Abelian groups. But I can not find the mistake in the following counter example, I must missed something obvious, $$0\rightarrow \mathbb{Z} \xrightarrow{ z\times2 \oplus z\text{ mod }2} \mathbb{Z}\oplus \mathbb{Z}/2 \xrightarrow{ \text{ mod }2\circ\pi_\mathbb{Z} } \mathbb{Z}/2 \rightarrow 0.$$
The first map is injective, second map is surjective, and the image of first map is the kernel of the second map.
And it fails to be exact with the same reason for $0\rightarrow \mathbb{Z}\xrightarrow{z\times 2} \mathbb{Z} \xrightarrow {(\text{mod }2)}\mathbb{Z}/2 \rightarrow 0$, there is no non-zero homomorphism from $\mathbb{Z}/2$ to $\mathbb{Z}$.
Thank you.