# How to test when an endomorphism is a monomorphism

Take a morphism $f:X\to X$ in a category with the same domain and codomain. I want to test whether $f$ is a monomorphism. This means, taking arbitrary $g_1,g_2:Y \to X$ with $f\circ g_1=f\circ g_2$ it should follow that $g_1=g_2$.

Does it suffice for a retraction $f:X\to X$ to be a monomorphism that for all $g_1,g_2:X \to X$ with $f\circ g_1=f\circ g_2$ it follows that $g_1=g_2$?

-
The last sentence doesn't make any sense to me. The condition "for all $g_1,g_2:X\to X$ it follows that $g_1=g_2$" has nothing to do with $f$. –  Alon Amit Mar 3 '12 at 9:25
Sorry, typo. Fixed. –  roadrunner Mar 3 '12 at 10:40
If your category is additive (don't actually remember if additive is enough, but if you go with "abelian" then you're sure) it is enough that $\ker f =0$. –  Andy Mar 3 '12 at 13:08
If $f: X\to Y$ is a retraction (even if domain and codomain are not the same) then it is indeed sufficient to consider maps $g_1,g_2: X\to X$ in the above: let $s: Y \to X$ be a map with $f\circ s = id_Y$, then you have $f\circ s\circ f = f = f\circ id_X$. Therefore $s\circ f = id_X$ and $f$ is in fact an isomorphism with inverse $s$.