I'm struggling to prove this statement, using the definitions below (I'm assuming the proof for the statement about epimorphisms is analogous). I know that a morphism $f:x\to y$ is monic if and only if it has zero kernel, however, when drawing the diagram, that gives me maps to the left of $f:x\to y$, while, letting $z=\mathrm{coker}(f)$, presuming $f:x\to y$ to be the kernel of $y\to z$, I want to have that for any $g:w\to y$ s.t. $w\to y\to z = 0$, I want $\exists!\ w\to x$. Unfortunately, $w$ is in the wrong position to use the universal property either of $\ker\ f$ or of $\mathrm{coker}\ f$. How would this be done?
Definitions:
A category $\mathcal{A}$ is said to be abelian if
- $\forall\ x,y,z\in\mathcal{A}$, $\mathrm{Mor}(x,y)$ is an abelian group, and $\mathrm{Mor}(x,y)\times\mathrm{Mor}(y,z)\xrightarrow{\mathrm{comp}}\mathrm{Mor}(x,z)$ is bilinear (this condition is called preadditivity)
- $\mathcal{A}$ has a zero object, as well as finite direct sums – using preadditivity, this tells us that we have products and coproducts, which are the same in a preadditive category (this condition + preadditivity is known as additivity)
- For every morphism $x\xrightarrow{f}y$, $\ker\ f$ and $\mathrm{coker}\ f$ exist. We also define $\mathrm{im}\ f=\ker(\mathrm{coker}\ f)$, $\mathrm{coim}\ f=\mathrm{coker}(\ker\ f)$).
- For every morphism $x\xrightarrow{f}y$, $\mathrm{im}\ f\cong\mathrm{coim}\ f$.
You haven't used the fourth axiom, which is key here (without it the statement is false). If $f : x \to y$ is monic, it has trivial kernel, and so $\text{coim}(f)$ is just $x$. By axiom 4, this is also $\text{im}(f)$. This says precisely that $f$ is the kernel of its cokernel.
For a counterexample with axiom 4 dropped, consider the category of Hausdorff topological vector spaces over $\mathbb{R}$. Here the monomorphisms are the injective maps, but the kernels are the injective maps with closed image. It's a nice exercise to figure out what the image and coimage are here.