Let $R$ be a commutative ring and let $I \subset R$ be an ideal. For any $n \ge 1$, the ring homomorphism $R \rightarrow R/I^n$ is surjective, hence an epimorphism in the category of rings. What about the natural map $R \rightarrow \hat{R_I}:=\lim_n R/I^n$ to the $I$-adic completion of $R$? This map is no longer surjective, but is it nevertheless an epimorphism?
If it is not an epimorphism in general, then I would also be interested in hearing about classes of rings for which it is an epimorphism. For example, does it hold for the p-adic integers?
(1) If $\mathbb{Z} \to \mathbb{Z}_p$ was an epimorphism, this would imply that $\mathbb{Q} \to \mathbb{Z}_p \otimes_{\mathbb{Z}} \mathbb{Q} = \mathbb{Q}_p$ is an epimorphism. But $\mathbb{Q}$ is a field and $\mathbb{Q} \to \mathbb{Q}_p$ is not surjective, so this is a contradiction.
(2) I think that $R \to \widehat{R}_I$ is almost never an epimorphism.
(3) See here for a classification of epimorphisms $\mathbb{Z} \to A$.
(4) There was a seminar about epimorphisms of commutative rings. For example, Prop. 1.5 in D. Lazard's "Epimorphismes plats" tells us that $f : A \to B$ is an epimorphism of commutative rings if and only if the following conditions are satisfied:
The second condition fails for $\mathbb{Z} \to \mathbb{Z}_p$ if we take $\mathfrak{p}=0$.