Morphisms with zero cokernel 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.
 A: I believe the following counterexample works.
Define $\mathcal{C}$ to be the category with $4$ objects $0,A,B,C$, where $0$ is the zero object, and with, in addition to the identities and zero arrows :


*

*one arrow $f:A\to B$

*one arrow $q:B\to C$

*a collection of arrows $\beta_n:B\to B$ for $n\geq 1$.


The compositions between these arrows are given by $q\circ f=0=q\circ \beta_n$, $\beta_n\circ f=f$ and $\beta_n\circ\beta_m = \beta_{n+m}$ for all $n,m\geq 1$.
Then $q$ is the only non-zero arrow $g$ such that $g\circ f$ exists and is zero, and thus it must be its cokernel. Moreover, any arrow $h$ with codomain $B$ other than the identity $1_B$ is such that $q\circ h=0$, and also factors uniquely through $\beta_1$ (because $\beta_1$ is a monomorphism, and $\beta_n=\beta_1\circ\beta_{n-1}$ for all $n> 1$ and $f=\beta_1\circ f$). Thus $\beta_1$ is the kernel of $q$.
Thus in this case the factorisation of $f$ as $\ker(\operatorname{coker}(f))\circ f'$ is simply $f=\beta_1\circ f$. But $\operatorname{coker}(f)=q\neq 0$.
A: My claim concerning the category of groups was wrong. Here is a counterexample. Let $D_8$ be the dihedral group of order $8$ which has the presentation $\langle x, a \mid a^4 = x^2 = xax^{-1}a = e \rangle $. Let $K = \lbrace e, x, a^2, a^2x \rbrace$ which is one of the Klein groups of order $4$ sitting in $D_8$ and let $C = \lbrace e, x \rbrace$ which is a non-normal subgroup of $D_8$, but a normal subgroup of $K$. If $i : C \to K$, $j : C \to D_8$ and $k : K \to D_8$ denote inclusions, we get $ker(coker(j)) = k$. Therefore $j = ker(coker(j)) \circ i$, but $coker(i) \ne 0$ since $K/C \ne 0$.
