TITLE: if a function $f$ is a Regular-monomorphism for two functions $g,h :Y\to Z$ and its an epimorphism, then it's an isomorphism.
QUESTION [1 upvotes]: My take: let $f:X\to Y$ be a regular monomorphism for $g,h: Y\to Z$:
by assumption, $g\circ f=h\circ f$, and for every other $x,y:A \to Y$ such that $g(x)=h(y)$, there exists a unique function from $A\to X$ call it $u_x$ and $u_y$ for each $x,y$. (We know they are one and the same but that's not needed at the moment. I don't think)
Hence, $g(f(u_x))=h(f(u_y))$ we know that $f(u_x)=f(u_y)=x=y$; therefore, $(gf)u_x=(hf)u_x$.
Therefore, $gf=hf=I_y$. (i think this is wrong. $gf$ cant be a function from $Y \to Y$)
Seems like everything i have so far is wrong. (This is wrong)
Any Ideas on how to prove it?
I haven't proven surjectivity, or injectivity. I am trying to build The Elementary Theory of the Category of Sets from scratch.
Before you ask me any further questions like: why "sets" why "functions." It's in the book. I didn't come up with the question or the wording. I have 4 axioms and 10 definitions (so far) and this turns out to be an exercise following the fact that every equalizer is monic. That's pretty much all I have. I have injectivity, but no surjectivity (it is "yet to be proven," as the author says).
I am working, as it seems by the author's absolutely repitative insistence, in the category of sets; however, not everything set-theoretic is workable so far (like 1-1 and onto $\iff$ surjective).

REPLY [2 votes]: Note that since $f$ is an epimorphism $g=h$. Thus, we see that $1_Y$ fits the equalizer diagram, so that there exists $k : Y \rightarrow X$ such that $f \circ k = 1_Y$. This implies that
$f \circ k \circ f  = f = f \circ 1_X$, and since $f$ is a monomorphism, we get that $k\circ f= 1_X$. Thus we showed that $k$ is an inverse of $f$.
{"set_name": "stack_exchange", "score": 1, "question_id": 4021546}