I want to show that
if $f:A\to B$ is a morphism in the category of abelian groups and $j:B\to B/f(A)$ is the canonical projection onto the quotient $B/f(A)$, then $j$ is a cokernel of $f$.
What I have tried so far:
If $h:B\to D'$ is such that $jh=0$, then we know by the universal property there is a unique morphism $\gamma:D\to D'$ such that $\gamma j=h$.
Now suppose $\pi : B \to coker(f)$ is the natural projection and $h$ is as above, then if I had that $j$ is actually $j:coker(f)\to D$, it would follow that $\pi$ is also cokernel of $f$ because we have then a unique morphism $\gamma j : coker(f)\to D'$ such that $(\gamma j)\pi = h$, so that we get the desired isomorphism.
One can prove in any category that
So to show what you want it is enough to prove that the quotient map $j:B\to B/f(A)$ is a cokernel for $f$, for then $B/f(A)$ will be isomorphic to the codomain of any other cokernel of $f$. Now if $g:B\to D$ is a morphism such that $gf=0$, then you know that $f(A)$ is contained in the kernel of $g$, and therefore by the universal property of quotients that there exists a morphism $\bar g:B/f(A)\to D$ such that $g=\bar g\circ j$. As the map $j$ is surjective, this is the only such map $\bar g$, and this is precisely what it means for $j$ to be a cokernel of $f$.