Mac Lane and Moerdijk have a neat proof on p. 197 that, in a topos $\mathcal{E}$, every epimorphism $f \colon C \to B$ is a coequalizer. But this depends on the assumption that the slice category $\mathcal{E}/B$ is itself a topos.
The Elephant gets there sooner, and has a proof by p. 38 that, in a (pre)topos, every epimorphism is a coequalizer. But again this depends on some moderately fancy earlier moves.
So here's the question: is there a significantly more elementary proof of the result which requires less scene-setting, requires only relatively small steps on from the definition of an elementary topos?
I had the impression that I'd somewhere, sometime, seen a simpler proof (indeed, maybe even here on math.se??). But I can't locate one: so maybe I'm just having a senior moment!
We will show that in fact, any epimorphism $f : C \to B$ in a topos is effective, i.e. $f$ is the coequalizer of the two projections $C \times_B C \to C$. Thus, suppose we have a morphism $g : C \to X$ such that $g \circ \pi_1 = g \circ \pi_2$. Then set $I$ to be the image of $(f, g) : C \to B \times X$. We claim that the first projection $I \to B$ is an isomorphism; then the required morphism $B \to X$ will be the composition of the inverse of $I \to B$ with the second projection $I \to X$ (and the uniqueness of the map $B \to X$ will be an immediate consequence of $f$ being an epimorphism).
To see this, first note that the projection $\bar \pi_1 : I \to B$ is certainly an epimorphism, since $\pi_1 \circ (f, g) = f$ is an epimorphism. Therefore, we reduce to showing that the projection $I \to B$ is a monomorphism. To see this, suppose we have two morphisms $i, j : U \to I$ such that $\bar\pi_1 \circ i = \bar\pi_1 \circ j$. Then there exists an epimorphism $V \to U$ and two morphisms $\bar i, \bar j : V \to C$ making appropriate commutative diagrams with $i,j$ respectively. But then the fact that $\bar \pi_1 \circ i = \bar \pi_1 \circ j$ implies that $(\bar i, \bar j)$ induces a morphism $V \to C \times_B C$. Therefore, the assumption $g \circ \pi_1 = g \circ \pi_2$ implies that $g \circ \bar i = g \circ \bar j$; and from $V \to U$ being an epimorphism, we get that $\bar \pi_2 \circ i = \bar \pi_2 \circ j$ also. From here, we can conclude that in fact $i = j$.
In case there is any difficulty in filling in the details of this argument, let me just comment that this is a categorization of this completely elementary argument for the case of $\mathsf{Set}$: first, with the given setup, the assumption $g \circ \pi_1 = g \circ \pi_2$ amounts to the requirement that whenever $c_1, c_2 : C$ are such that $f(c_1) = f(c_2)$, then $g(c_1) = g(c_2)$. Now, $I = \{ (b, x) : B \times X \mid \exists c : C, f(c) = b \land g(c) = x \}$. It is immediate from $f$ being surjective that every $b : B$ occurs as a first coordinate of an element of $I$. On the other hand, if $(b, x_1), (b, x_2) \in I$, then there exist $c_1, c_2 : C$ such that $f(c_1) = f(c_2) = b$, $g(c_1) = x_1$, and $g(c_2) = x_2$. But then the assumption $g \circ \pi_1 = g \circ \pi_2$ gives $x_1 = x_2$. Thus, we have shown that $I$ is the graph of some function $B \to X$.
(Also, let me observe that the dependencies of the topos case argument are: that a topos is balanced, i.e. every morphism which is a monomorphism and an epimorphism is an isomorphism; the existence of images, i.e. epi-mono factorizations; and that in a topos, epimorphisms are stable under pullbacks.)