I'm stuck on Exercise 5.2.1 of Goldblatt's "Topoi: A Categorial Analysis of Logic":
Given a function $f:A\to B$, if $h\circ g: A\twoheadrightarrow C\rightarrowtail B$ and $h'\circ g': A\twoheadrightarrow C'\rightarrowtail B$ are two different epic-monic factorisations of $f$ (i.e. $f=h\circ g=h'\circ g'$), then there exists a unique $k:C\to C'$ such that
commutes, and furthermore $k$ is iso in $\mathbf{Set}$.
The rest of the section seems okay. It gives a categorical proof in any topos. However, I'd like a set-theoretic proof please.
I've tried defining $k: C\to C'$ by way of equivalence classes; namely, by letting $k(c)=g'(\gamma)$ for some $\gamma$ with $c=g(\gamma)$, so that since $g$ in onto, I can iron out any ambiguity by saying $\gamma\sim_{g}\delta$ iff $g(\gamma)=g(\delta)$, then go from there. (Do you see what I mean?) I can't get it to work.
Please help :)

I would use the context of binary relations for a clear proof.
Let $r$ be a relation between $A$ and $B$, i.e. $r\subseteq A\times B$ (or $r:A\times B\to\{false,\ true\}$ if you prefer), and let $\def\inv{^\smallsmile} r\inv$ denote the inverse relation $\subseteq B\times A$. Using infix notation, it means that $$a\mathop rb\iff b\mathop{r\inv}a\,.$$ Also, define $r\le r'$ iff $r\subseteq r'$ as sets, i.e. $r(a,b)\Rightarrow r'(a,b)$ for all $a\in A,\,b\in B$.
Let me write composition of relations from left to right and $1_A$ for the equality relation on set $A$.
Verify that for a relation $f\subseteq A\times B$ we have that
Thus in our situation, we have $g\inv g=1_C=hh\inv$ and the same way, $g_1\inv g_1=1_{C'}=h_1h_1\inv$.
Now $k:=g\inv g_1$. This also equals to $hh_1\inv$ because $g\inv g_1h_1=g\inv f=g\inv gh=h $, so
$g\inv g_1=g\inv g_1h_1h_1\inv=h\,h_1\inv$.
Finally, $k\inv=g_1\inv g$ and we can easily check that $kk\inv=1_C$, and by the same argument, $k\inv k=1_{C'}$, which proves that $k$ is a bijection.