Examples for the fact that a pullback of an epimorphism is not necessarily an epimorphism. I'm reading in Borceux' book Basic Category Theory about pullbacks. It turns out that the pullback of an epimorphism is not necessarily an epimorphism. On the linked page, Borceux gives a counterexample in the category Haus.
I was wondering whether there also exist easy counterexamples in Ring, the category of commutative rings with a 1 element (or in Grp, Rng, etc.). I have been playing around with the embedding of $\mathbb{Z}$ in $\mathbb{Q}$, which is an epimorphism, but I couldn't find anything.
 A: This is supposed to be an answer to a tiny fraction of your question: In $\mathsf{Grp}$ epis are stable under pullbacks (therefore you can stop searching for a counterexample there).
This is because in $\mathsf{Grp}$ every epi is regular and regular epis are stable under taking pullbacks, because $\mathsf{Grp}$ (and more generally every category of universal algebras) is a regular category.
The same applies for example to $\mathsf{Set}$ and to every abelian category, in particular $R\mathsf{Mod}$ for every ring $R$.
Actually, in a (concrete) category of universal algebras $(\mathcal{A}, U : \mathcal{A} \to \mathsf{Set})$ a morphism is a regular epi if and only, if it is surjective (its underlying function is surjective). We can conclude, that the following are equivalent for $\mathcal{A}$:


*

*every epi is regular ("epi $=$ regular epi")

*every epi is surjective ("epi $=$ surjective")

*$\mathcal{A}$ is balanced ("mono & epi $\Rightarrow$ iso")


Hence, every concrete "algebraic" category satisfying one of the equivalent conditions above is off the table for counterexamples (again: regular epis are stable under pullbacks in a regular category)
A: An example in $\mathsf{Ring}$ is the inclusion $\mathbb{C}[t]\to\mathbb{C}[t,t^{-1}]$, which is an epimorphism, but whose pullback along $\mathbb{C}[t^{-1}]\to\mathbb{C}[t,t^{-1}]$ is $\mathbb{C}\to\mathbb{C}[t^{-1}]$, which is not an epimorphism.
However, every pullback of $\mathbb{Z}\to\mathbb{Q}$ is an epimorphism. There's a proof in the answer to this related question.
A: Let $k$ be an algebraically closed field,  consider the category of quasi affine varieties and $U$ a Zariski open subset  of $k^n$, such that $U=k^n-Z(f)$ where $f$ is a polynomial function. The imbedding $i:U\rightarrow k^n$ is an epimorphism, consider the embedding $j:V(f)\rightarrow k^n$, the pullback of $j:V(f)\rightarrow k^n$ is the $\phi\rightarrow V(f)$ is not an epimorphism.
