This question already has an answer here:
Following Weibel's book on homological algebra, he states without proof that every morphism $f\colon A \to B$ can be written as composition of an epimorphism followed by a monomorphism.
After many attempts,I am unable prove this. It is easy to show that
$f\colon A \to B$ factors as $ A \twoheadrightarrow Coker(Ker(f)) \to B$ and $A \to Ker(Coker(f))\rightarrowtail B$ .Moreover there is an arrow from $Ker(Coker(f)) \to Coker(Ker(f))$ such that the all the diagrams commute.
Additionaly, in Hilton and Stammbach's book on the same subject, they take this property as an axiom.