Suppose we are working in an abelian category. Prove that any map has a decomposition where the left arrow is epi and the right arrow is monic.

My attempt of solution

Let's consider cokernel of f: it exists since we are in abelian category. For the same reason the cokernel has a kernel .

Since there is map such that . This is the factorization we were looking for.

Immediatly we see, that the right arrow is monic (since kernels are monics), so the only problem is to prove that is epi. And this is the thing i cannot do

I was unable to prove that since i cannot see any nonzero arrows from (and I need such arrow in order to use cokernel universality property).

Yet I was able to see some things...

Let . One thing I was able to notice is that . It is obvious that we have to use property, that the rightmost arrow is a cokernel (we can do the above construction with any map for which composition with f is 0, but f' need not to be epi). However again I don't see any arrows from B (so i cannot use cokernel property).

I had some other idea to deal with it. Let us start "from the other side". So consider kernel of f: . The analogous construction yields decomposition where the first arrow is and the second one is denoted by .

I was able to construct a map which has good "composition properties" (the corresponding triangles are commutative), however i was unable to prove that is an isomorphism (i was unable to construct the arrow in the opposite direction).

I would appreciate any ideas concerning this problem.