In the category of rings, what is an example of an epimorphism that is not a retraction? It seems to me that if you have a epimorphism $f:R\to S$ , then $f$ is surjective.
I want to show that there is no $g:S\to R$ such that $f \circ g = 1_S$. But could we not define $g$ to be a constant map sending every element in $S$ to the element $r$ in $R$ such that $f(r) = 1_S$ thus finding the homomorphism we need, and showing that $f$ is indeed a retraction? 

For start it isn't always the case that an epimorphism is surjective, at least in $\mathbf{Ring}$.
A counterexample is given by the canonical embedding of $i \colon \mathbb Z \to \mathbb Q$. This mapping is an epimorphism because for every pair $f,g \colon \mathbb Q \to L$ if $f \circ i=g \circ i$ then by the universal property of $i$ (or if you prefer since $\mathbb Q$ is the field of fraction for $\mathbb Z$) it follows that $f=g$, but $i$ is not a surjective mapping.
