Every geometric morphism between toposes factors into a geometric surjection followed by a geometric embedding. This exhibits an image construction in the topos-theoretic sense, and gives rise to a factorization system in a 2-category for Topos.
There is a factorization system on the 2-category Topos whose left class is the surjective geometric morphisms and whose right class is the geometric embeddings.
Moreover, the factorization of a given geometric morphism $f : \mathcal{E} \to \mathcal{F}$ is, up to equivalence, through the canonical surjection onto the topos of coalgebras $f^* f_* CoAlg(\mathcal{E})$ of the comonad $f^* f_* : \mathcal{E} \to \mathcal{E}$:
This appears for instance as (MacLaneMoerdijk, VII 4., theorem 6).
We use the following lemma
Let $j$ be a Lawvere-Tierney topology on a topos $\mathcal{E}$ and write $i : Sh_j(\mathcal{E}) \to \mathcal{E}$ for the corresponding geometric embedding.
Then a geometric morphism $f : \mathcal{F} \to \mathcal{E}$ factors through $i$ precisely if
or, equivalently
This appears as (MacLaneMoerdijk, VII 4. prop. 2).
We first show the first statement, that for $f$ to factor it is sufficient for $f_*$ to take values in $j$-sheaves: in that case, set
Since by assumption the unit map $x \to i_* i^* x$ is an isomorphism on the image of $f_*$ this indeed serves to factor $f_*$:
The left adjoint to $p_*$ is then
because
where in the middle steps we used that $f_* F$ is a $j$-sheaf, by assumption, and that $i_*$ is full and faithful.
It is clear that $p^*$ is left exact, and so $(p^* \dashv p_*)$ is indeed a factorizing geometric morphism.
We now show that $f_*$ taking values in sheaves is equivalent to $f^*$ mapping dense monos to isos.
Let $u : U \hookrightarrow X$ be a $j$-dense monomorphism and $A \in \mathcal{E}$ any object. Consider the induced naturality square
of the adjunction natural isomorphism. If now $f_* A$ is a $j$-sheaf and $u$ a dense monomorphism, then by definition the left vertical morphism is also an isomorphism and so is the right one. By the Yoneda lemma this being an iso for all $A$ is equivalent to $f^* u$ being an iso. And conversely.
Let $f : \mathcal{F} \to \mathcal{E}$ be any geometric morphism.
We first discuss the existence of the factorization, then its uniqueness.
To construct the factorization, we shall give a Lawvere-Tierney topology on $\mathcal{E}$ and factor $f$ through the geometric embedding of the corresponding sheaf topos.
Take the closure operator $\overline{(-)} : Sub(-)_{\mathcal{E}} \to Sub(-)_{\mathcal{E}}$ to be given by sending $U \hookrightarrow X$ to the pullback
where the bottom morphism is the $(f^* \dashv f_*)$-unit. One checks that this is indeed a closure operator by the fact that $f^*$ preserves both pullbacks and pushouts.
Notice that this implies that for two subobjects $U_1, U_2 \hookrightarrow X$ we have
Write $j$ for the corresponding Lawvere-Tierney topology and
for the corresponding geometric embedding.
By lemma 1 we get a factorization through $I$ if $f^*$ sends $j$-dense monomorphisms to isomorphisms. But if $U \hookrightarrow X$ is dense so that $X \subset \overline{U}$ then, by (1), $f^* X \subset f^* U$ and hence $f^* X = f^* U$.
Write
for the factorization thus established. It remains to show that $p$ here is a geometric surjection. By one of the equivalent characterizations discussed there, this is the case if $p^*$ induces an injective homomorphism of subobject lattices.
So suppose that for subobjects $U_1, U_2 \subset X$ we have $p^* U_1 \simeq p^* U_2$. Observe that then also $f^* i_* U_1 \simeq f^* i_* U_2$, because
by the fact that $i_*$ is full and faithful. With (1) it follows that also
and hence
by the very fact that $i_*$ includes $j$-sheaves in general, hence $j$-closed subobjects in particular. Finally since $i_*$ if a full and faithful functor this means that
So $p^*$ is indeed injective on subobjects and so $p$ is a geometric surjection.
This establishes the existence of a surjection/embedding factorization. Next we discss that this is unique.
So consider two factorizations
into a geometric surjection followed by a geometric embedding.
We will now argue that $i_1$ factors – essentially uniquely – through $i_2$ in a way that makes
commute up to natural isomorphisms. By the same argument for the upside-down situation we find an essentially unique middle vertical morphism $h : \mathcal{B} \to \mathcal{A}$ the other way round. Then essential uniqueness of these factorizations implies that $g \circ h \simeq Id$ and $h \circ g \simeq Id$. This means that the original two factorizations are equivalent.
To find $g$ and $h$, use again that every geometric embedding (by the discussion there) is, up to equivalence, an inclusion of $j$-sheaves for some $j$. Find such a $j$ the bottom morphism and then use again lemma 1 that $i_1$ factors through $i_2$ – essentially uniquely – precisely if $i_1^*$ sends dense monomorphisms to isomorphisms.
To see that it does, let $IU \to X$ be a dense mono and consider the naturality square
Since $i_2^*(U \to X)$ is an iso by definition, the left vertical morphism is, and thus so is the right vertical morphism. But since $p_1$ is a geometric surjection we have (by the discussion there) that $p_1^*$ is conservative, and hence also $i_1^* U \to i_1^* X$ is an isomorphism.
Hence $i_1$ factors via some $g$ through $i_2$ and the proof is completed by the above argument.
For $f : X \to Y$ a continuous function between topological spaces and $X \to im(f) \to Y$ its ordinatry image factorization through an embedding, the corresponding composite of geometric morphisms of sheaf toposes
is a geometric surjection/geometric embedding factorization.
For $\mathcal{E}$ any topos, $f : X \to Y$ any morphism in $\mathcal{E}$, and $X \to im(f) \to Y$ its image factorization, the corresponding composite of base change geometric morphisms
is a geometric surjection/embedding factorization.
For $f : C \to D$ any functor between categories, write $C \to im(f) \to D$ for its essential image factorization. Then the induced composite geometric morphism of presheaf toposes
is a geometric surjection/embedding factorization.
See (MacLaneMoerdijk, p. 377).
Section VII. 4. of