If the given short exact sequence
$$ 0\to M'\xrightarrow{f}M\xrightarrow{g}M''\to0 $$
splits then why is $M$ isomorphic to the internal direct sum of $M'$ and $M''$?
I know that if this sequence splits then $M$ is the internal direct sum of the image of $f$ and $\ker f'$ where $f'$ is the right inverse of $f$ and also $M$ is the internal direct sum of the kernel of $g$ and the image of $g'$ where $g'$ is the left inverse of $g$ then how can I say that $M$ is the internal direct sum of the image of $f$ and kernel of $g'$? How can I say this to get the desired result by exactness?