**Motivation:**

Say $F: D \to Sch$ is a diagram in the category of schemes, and we're interested in whether it has a colimit (gluings, pushouts, and "categorical" quotients are all examples of colimits). Its colimit $Q$ in the category of locally ringed spaces always exists, and a scheme $Y$ is the scheme-colimit of $F$ iff there is a map $Q\to Y$ that is "initial among maps to schemes", i.e. any other map from $Q$ to a scheme factors through it.

Thus the problem of when colimits of schemes exists can be answered if we know when a locally ringed space admits a "schemification".

**Examples:**

1) The process of turning a classical variety $V$ into a "variety with generic points" $V^s$ is a schemification. Proving this boils down the classical affine case. If $R$ is a finite-type reduced $k=\overline{k}$-algebra, and we map $V=mSpec(R)$ to a scheme $Y$, first cover $Y$ by affines $Spec(B_i)$, and then pull back this cover to $V$ and refine it by principal opens $mSpec(R_{f_{ij}})$, so we have maps $B_i \to R_{f_{ij}}$ that determine the map $V\to Y$ (by the adjunction of $Spec({\cal O}(-))$ to the inclusion $AffSch\hookrightarrow LRS)$. But these define the desired map $V^s\to Y$ because $V^s$ can be obtained by gluing $Spec(R_{f_{ij}})$.

2) For $k=\overline{k}$, if we let $\mathbb{G_m}=\mathbb{A}^1_k\setminus 0$ act on $\mathbb{A}^1_k$, then the coequalizer in schemes of the action and the projection $G_m \times_k \mathbb{A}^1_k \rightrightarrows \mathbb{A}^1_k$ (i.e. the "categorical quotient") is $Spec(k)$, hence the locally ringed space coequalizer $Q$, which has two points and is not a scheme, has $Spec(k)$ as its schemification.

3) Some locally ringed spaces have no schemification; for example, two affine lines glued along their generic points. This is precisely because the gluing diagram has no coequalizer in schemes, as per BCnrd and Anton Geraschenko's answer here.

When does a locally ringed space $X$ admit a "schemification", i.e. a map to a scheme $X^s$ through which any other map to a scheme must factor?

**EDIT:** (Response to Martin's answer)

4) Any locally ringed space $X$ with exactly one closed point $x$ has its "affinization", $X^a:=Spec({\cal O}_X(X))$, as a schemification. This is because in a map $F:X\to Y$ with $Y$ a scheme, every point maps to a generization of $f(x)$, so and since open sets are closed under generization, $f$ factors through an affine neighborhood of $f(x)$. But any map from $X$ to an affine factors uniquely through $X^a$, so we're done.

5) Schemification commutes with disjoint unions, in that if $X= \coprod X_i$ then $X^s$ exists iff all $X_i^s$ exist, and in that case $X^s = \coprod X_i^s$. So *if $X$ is locally connected*, since it then decomposes into a disjoint union of connected clopen components, we might as well assume it is connected.