Quotient Mapping is Coequalizer

Theorem
Let $\mathbf{Set}$ be the category of sets.

Let $S$ be a Set, and let $\mathcal R \subseteq S \times S$ be an equivalence relation on $S$.

Let $r_1, r_2: \mathcal R \to S$ be the projections corresponding to the inclusion mapping $\mathcal R \hookrightarrow S \times S$.

Let $q: S \to S / \mathcal R$ be the quotient mapping induced by $\mathcal R$.

Then $q$ is a coequalizer of $r_1$ and $r_2$ in $\mathbf{Set}$.

Proof
Let $f: S \to T$ be a mapping as in the following commutative diagram:


 * $\begin{xy}

<8em,0em>*+{S / \mathcal R} = "E", <0em,0em>*+{\mathcal R}    = "C", <4em,0em>*+{S}             = "D", <8em,-4em>*+{T}            = "A",

"C"+/^.3em/+/r.5em/;"D"+/^.3em/+/l.5em/ **@{-} ?>*@{>} ?*!/_.8em/{r_1}, "C"+/_.3em/+/r.5em/;"D"+/_.3em/+/l.5em/ **@{-} ?>*@{>} ?*!/^.8em/{r_2}, "D";"E" **@{-} ?>*@{>} ?*!/_.8em/{q}, "E";"A" **@{.} ?>*@{>} ?*!/_.8em/{\bar f}, "D";"A" **@{-} ?>*@{>} ?*!/^.8em/{f}, \end{xy}$

This translates to, for $s_1, s_2 \in S$ with $s_1 \mathcal R s_2$:


 * $f \circ r_1 \left({s_1, s_2}\right) = f \circ r_2 \left({s_1, s_2}\right)$

i.e. $f \left({s_1}\right) = f \left({s_2}\right)$.

The commutativity of the diagram implies that we must define $\bar f: S / \mathcal R \to T$ by:


 * $\bar f \left({\left[\!\left[{s_1}\right]\!\right]}\right) = f \left({s_1}\right)$

since $q \left({s_1}\right) = \left[\!\left[{s_1}\right]\!\right]$.

The above condition precisely states that $\bar f$ is well-defined.

In conclusion, for any $f$ with $f \circ r_1 = f \circ r_2$, there is a unique $\bar f$ making the diagram commute.

That is, $q$ is a coequalizer of $r_1$ and $r_2$.