In a pointed category $\mathbf{C}$ with kernels and cokernels each morphism $f : A \to B$ factors as $f = ker(coker(f)) \circ f'$ with some morphism $f' : A \to K$. In abelian categories $f'$ is an epimorphism. This is also true in some nonabelian categories, for example in the category of pointed sets. The category of groups is an example where $f'$ is in general no epimorphism, but it is a homomorphism with $coker(f') = 0$.
In abelian categories and in the category of pointeds sets epimorphims coincide with morphisms having zero cokernel. The question is:
In the above factorization, is it always true that $coker(f') = 0$?
A counterexample would be welcome.