Denote $h : R \to X$ denote the composition of either $s$ or $t$ with $g$. Then $h$ is proper by Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-base-change-proper} and \ref{spaces-morphisms-lemma-composition-proper}. The sheaves $$ g_*\mathcal{O}_Y \quad\text{and}\quad h_*\mathcal{O}_R $$ are coherent $\mathcal{O}_X$-algebras by Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-proper-pushforward-coherent}. The $X$-morphisms $s$, $t$ induce $\mathcal{O}_X$-algebra maps $s^\sharp, t^\sharp$ from the first to the second. Set $$ \mathcal{A} = \text{Equalizer}\left(s^\sharp, t^\sharp : g_*\mathcal{O}_Y \longrightarrow h_*\mathcal{O}_R\right) $$ Then $\mathcal{A}$ is a coherent $\mathcal{O}_X$-algebra and we can define $$ X' = \underline{\Spec}_X(\mathcal{A}) $$ as in Morphisms of Spaces, Definition \ref{spaces-morphisms-definition-relative-spec}. By Morphisms of Spaces, Remark \ref{spaces-morphisms-remark-factorization-quasi-compact-quasi-separated} and functoriality of the $\underline{\Spec}$ construction there is a factorization $$ Y \longrightarrow X' \longrightarrow X $$ and the morphism $g' : Y \to X'$ equalizes $s$ and $t$. \medskip\noindent Before we show that $X'$ is the coequalizer of $s$ and $t$, we show that $Y \to X'$ and $X' \to X$ have the desired properties. Since $\mathcal{A}$ is a coherent $\mathcal{O}_X$-module it is clear that $X' \to X$ is a finite morphism of algebraic spaces. This proves (1). The morphism $Y \to X'$ is proper by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-universally-closed-permanence}. This proves (2). Denote $Y \to Y' \to X$ with $Y' = \underline{\Spec}_X(g_*\mathcal{O}_Y)$ the Stein factorization of $g$, see More on Morphisms of Spaces, Theorem \ref{spaces-more-morphisms-theorem-stein-factorization-Noetherian}. Of course we obtain morphisms $Y \to Y' \to X' \to X$ fitting with the morphisms studied above. Since $\mathcal{O}_{X'} \subset g_*\mathcal{O}_Y$ is a finite extension we see that $Y' \to X'$ is finite and surjective. Some details omitted; hint: use Algebra, Lemma \ref{algebra-lemma-integral-overring-surjective} and reduce to the affine case by \'etale localization. Since $Y \to Y'$ is surjective (with geometrically connected fibres) we conclude that $Y \to X'$ is surjective. This proves (3). To show that $X' \to X$ is universally injective, we have to show that $X' \to X' \times_X X'$ is surjective, see Morphisms of Spaces, Definition \ref{spaces-morphisms-definition-universally-injective} and Lemma \ref{spaces-morphisms-lemma-universally-injective}. Since $Y \to X'$ is surjective (see above) and since base changes and compositions of surjective morphisms are surjective by Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-base-change-surjective} and \ref{spaces-morphisms-lemma-composition-surjective} we see that $Y \times_X Y \to X' \times_X X'$ is surjective. However, since $Y \to X'$ equalizes $s$ and $t$, we see that $Y \times_X Y \to X' \times_X X'$ factors through $X' \to X' \times_X X'$ and we conclude this latter map is surjective. This proves (4). Finally, if $g$ is surjective, then since $g$ factors through $X' \to X$ we see that $X' \to X$ is surjective. Since a surjective, universally injective, finite morphism is a universal homeomorphism (because it is universally bijective and universally closed), this proves (5). \medskip\noindent In the rest of the proof we show that $Y \to X'$ is the coequalizer of $s$ and $t$ in the category of algebraic spaces over $S$. Observe that $X'$ is locally Noetherian (Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-locally-finite-type-locally-noetherian}). Moreover, observe that $Y \times_{X'} Y \to Y \times_X Y$ is an isomorphism as $Y \to X'$ equalizes $s$ and $t$ (this is a categorical statement). Hence in order to prove the statement that $Y \to X'$ is the coequalizer of $s$ and $t$, we may and do assume $X = X'$. In other words, $\mathcal{O}_X$ is the equalizer of the maps $s^\sharp, t^\sharp : g_*\mathcal{O}_Y \to h_*\mathcal{O}_R$. \medskip\noindent Let $X_1 \to X$ be a flat morphism of algebraic spaces over $S$ with $X_1$ locally Noetherian. Denote $g_1 : Y_1 \to X_1$, $h_1 : R_1 \to X_1$ and $s_1, t_1 : R_1 \to Y_1$ the base changes of $g, h, s, t$ to $X_1$. Of course $g_1$ is proper and $R_1 = Y_1 \times_{X_1} Y_1$. Since we have flat base change for pushforward of quasi-coherent modules, Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-flat-base-change-cohomology}, we see that $\mathcal{O}_{X_1}$ is the equalizer of the maps $s_1^\sharp, t_1^\sharp : g_{1, *}\mathcal{O}_{Y_1} \to h_{1, *}\mathcal{O}_{R_1}$. Hence all the assumptions we have are preserved by this base change. \medskip\noindent At this point we are going to check conditions (1) and (2) of Lemma \ref{lemma-colimit-check-etale-locally}. Condition (1) follows from Lemma \ref{lemma-descend-etale-proper-surjective} and the fact that $g$ is proper and surjective (because $X = X'$). To check condition (2), by the remarks on base change above, we reduce to the statement discussed and proved in the next paragraph. \medskip\noindent Assume $S = \Spec(A)$ is an affine scheme, $X = X'$ is an affine scheme, and $Z$ is an affine scheme over $S$. We have to show that $$ \Mor_S(X, Z) \longrightarrow \text{Equalizer}(s, t : \Mor_S(Y, Z) \to \Mor_S(R, Z)) $$ is bijective. However, this is clear from the fact that $X = X'$ which implies $\mathcal{O}_X$ is the equalizer of the maps $s^\sharp, t^\sharp : g_*\mathcal{O}_Y \to h_*\mathcal{O}_R$ which in turn implies $$ \Gamma(X, \mathcal{O}_X) = \text{Equalizer}\left( s^\sharp, t^\sharp : \Gamma(Y, \mathcal{O}_Y) \to \Gamma(R, \mathcal{O}_R) \right) $$ Namely, we have $$ \Mor_S(X, Z) = \Hom_A(\Gamma(Z, \mathcal{O}_Z), \Gamma(X, \mathcal{O}_X)) $$ and similarly for $Y$ and $R$, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-morphism-to-affine-scheme}.