Is an injective function monomorphic (in category of sets)? How do I prove this?
Conversely, I could prove that a monomorphic function is injective in the following manner:
If f is monic, then $f\circ g = f\circ h\Rightarrow g= h$
Given the mapping $C\to A\to B$, where $g,h\colon C\to A$ and $f\colon A\to B$ Assume $f$ is non-injective then there are some $a$, $b$ in $A$ and $c$ in $B$ such that $f(a) = f(b) = c$
There are also $x$ and $y$ in $C$ such that $g(x) = a$ and $h(y) = b$ Thus $f(g(x) = f(h(y)) = c$, thus $f\circ g = f\circ h$, but $g \neq h$ but $g = h$ Thus $f$ cannot be non-injective
I could not prove it other way round, so is an injective function monic?
Suppose $f\colon A\to B$ is monic. Let $x,y\in A$ and consider the maps \begin{align} g&\colon \{x,y\}\to A, &&g(x)=g(y)=x\\ h&\colon \{x,y\}\to A, &&h(x)=h(y)=y \end{align} If $f(x)=f(y)$, then $f\circ g=f\circ h$. Since $f$ is monic, we derive $g=h$ and so $x=y$. Therefore $f$ is injective.
Assume $f\colon A\to B$ is injective and that $g,h\colon C\to A$ satisfy $f\circ g=f\circ h$. Then, for every $x\in C$, $$ f(g(x))=f(h(x)) $$ and, by the injectivity of $f$, $g(x)=h(x)$. Therefore, $g=h$ and $f$ is monic.
Note that the second argument works in every concrete category.