Let $R$ be a ring (for example $\mathbb{Z}$) and $A,B$ two $R$-modules.
Futhermore we have two morphisms $A \xrightarrow{f}B$ and $B \xrightarrow{g}A$ with property $g \circ f = id_A$.
My question is how to see that $ker(g) \cong coker(f) $?
My considerations:
We have $coker(f)= B/im(f)$ by definition and since $g \circ f = id_A$ $f$ is in injection so we can identify $A$ with $im(f)$.
So $coker(f) \cong B/A$. But I don't see how to settle $ker(g) \cong B/A$. Could anybody help?
Can the argument be generalized to any abelian category?
The trick is to prove the following equality (not merely an isomorphism): $$B=f(A)\oplus {\rm ker}(g)$$ and then the needed isomorphism is trivial, by factoring out by $f(A)$.
If you need help with this equality, just let me know.