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? 

(All my rings are unital, and all my ring homomorphisms preserve $1$.)
As Giorgio explains, not every epimorphism in $\mathbf{Ring}$ is a surjective homomorphism. Furthermore, its also the case that not every surjective homomorphism of rings is a retraction.
To see this, use:

Proposition. Let $n$ denote a non-zero natural number. Then there is no ring homomorphism $$\mathbb{Z}/n\mathbb{Z} \rightarrow \mathbb{Z}.$$

Trivially, this implies that the projection $$\mathbb{Z} \rightarrow \mathbb{Z}/n\mathbb{Z}$$ does not have a section $$\mathbb{Z}/n\mathbb{Z} \rightarrow \mathbb{Z}.$$
In other words, the projection $\mathbb{Z} \rightarrow \mathbb{Z}/n\mathbb{Z}$ is not a retraction.
Proof of proposition. Suppose for a contradiction that that $f : \mathbb{Z}/n\mathbb{Z} \rightarrow \mathbb{Z}$ is a ring homomorphism. Then $\mathrm{img}(f)$ is a subring of $\mathbb{Z}$. But since $n$ is non-zero, hence the domain of $f$ is finite. Thus $\mathrm{img}(f)$ is finite. So we deduce there exists a subring of $\mathbb{Z}$ that is finite. But since $\mathbb{Z}$ is infinite, we deduce in particular that there exists a subring of $\mathbb{Z}$ that is distinct from $\mathbb{Z}$.
But this contradicts the fact that the only subring of $\mathbb{Z}$ is $\mathbb{Z}$ itself.
