TITLE: coequalizers+pullbacks implies equalizers?
QUESTION [13 upvotes]: The question is on the title, I would like a hint on this exercise.
This is what I've tried so far:
Suppose we're given $f,g:A\rightarrow B$, let $h=\operatorname{Coeq}(f,g)$, then we have parallel arrows $h\circ f,h\circ g:A\rightarrow C$, so consider parallel arows $e_1,e_2:D\rightarrow A$ such that $e_1,e_2,h\circ f,h\circ g$ form a pullback, we have $e_1=\operatorname{eq}(f,g)$?
All hints are welcome. Thanks.

REPLY [6 votes]: Aleš Bizjak has already given a complete answer. A more conceptual proof is contained in Zhen Lin's comment. Building on this, I will prove the following refinement:

In a category with pullbacks any two parallel morphisms $f,g$ with the property $\exists u (uf=ug)$ have an equalizer.

In particular, coequalizers and pullbacks give equalizers. However, I find this special case a little bit misleading because it suggests some nontrivial and unexpected connection between colimits and limits. But this is an illusion. Instead of coequalizers, we just need a weaker amalgamation property. For a direct proof you can just read Aleš Bizjak's answer. The following proof tries to reduce the statement to more basic and well-known statements.

If $\mathcal{C}$ is a category with (binary) products and pullbacks, then $\mathcal{C}$ has equalizers: The equalizer of $f,g : X \to Y$ is the pullback of $X \xrightarrow{(1,f)} X \times Y \xleftarrow{(1,g)} X$. In particular, if a category has pullbacks and a terminal object, then it also has products, and therefore equalizers (and then in fact all finite limits)

Now let $\mathcal{C}$ be a category, $X \in \mathcal{C}$ and consider the slice category $\mathcal{C} \downarrow X$ together with the forgetful functor $p : \mathcal{C} \downarrow X \to \mathcal{C}$. One checks:

$p$ creates pullbacks: In fact, if $(A,a) \to (B,b) \leftarrow (C,c)$ is a diagram in $\mathcal{C} \downarrow X$, and $A \leftarrow A \times_B C \to C$ is a pullback in $\mathcal{C}$, then we define $p : A \times_B C \xrightarrow{(a,c)} X \times_X X = X$ and one checks that $(A,a) \leftarrow (A \times_B C,p) \rightarrow (B,b)$ is a pullback in $\mathcal{C} \downarrow X$ (and $p$ is unique with this property).
$p$ preserves equalizers. That is, if $(K,k) \xrightarrow{e} (A,a) \xrightarrow{f,g} (B,b)$ is an equalizer diagram in $\mathcal{C} \downarrow X$, then $K \xrightarrow{e} A \xrightarrow{f,g} B$ is an equalizer diagram in $\mathcal{C}$. Clearly it commutes. If $h : T \to A$ is a morphism with $fh=gh$, define $t:=bfh : T \to X$. Then $h : (T,t) \to (A,a)$ is a morphism of $fh=gh$ in $\mathcal{C} \downarrow X$, so that it factors uniquely through $e$. The rest is clear.

Thus, if $\mathcal{C}$ has pullbacks, then $\mathcal{C} \downarrow X$ has pullbacks and a terminal object (namely $(X,1)$). Therefore, it has equalizers. Thus, if morphisms $f,g : A \to B$ in $\mathcal{C}$ have some $u : B \to X$ with $v:=uf=ug$, they may be lifted to morphisms $f,g : (A,v) \to (B,u)$, which have an equalizer in $\mathcal{C} \downarrow X$ and therefore also in $\mathcal{C}$. $\square$
An interesting example is the category of local commutative rings with local homomorphisms $\mathsf{LR}$. One can check that the forgetful functor $U : \mathsf{LR} \to \mathsf{CRing}$ creates pullbacks. In order to verify the amalgamation property, we may reduce to the case of fields. But if $L \leftarrow K \rightarrow L$ are homomorphisms of fields, then $L \otimes_K L \neq 0$, hence has some maximal ideal $\mathfrak{m}$, and $(L \otimes_K L)/\mathfrak{m}$ gives what we want. It follows that $\mathsf{LR}$ has equalizers. But in the end they are simply created by $U$, which can be checked directly.
Perhaps someone knows a more interesting example where the existence of equalizers is not clear a priori?