Colimits of schemes This is related to another question.
I've found many remarks that the category of schemes is not cocomplete. The category of locally ringed spaces is cocomplete, and in some special cases this turns out to be the colimit of schemes, but in other cases not (which is, of course, no evidence that the colimit does not exist). However, I want to understand in detail a counterexample where the colimit does not exist, but I hardly found one. In FGA explained I've found the reference, that Example 3.4.1 in Hartshorne, Appendix B is a smooth proper scheme over $\mathbb{C}$ with a free $\mathbb{Z}/2$-action, but the quotient does not exist (without proof). To be honest, this is too complicated to me. Are there easy examples? You won't help me just giving the example, because there are lots of them, but the hard part is to prove that the colimit really does not exist.
 A: Direct limits of schemes fail to exist. A good example is the following: let X be a scheme and Z a closed subscheme defined by an ideal I. Then for any n we get the nth infinitesmal neighborhood Z^(n) defined by the ideal I^(n+1) and a diagram $Z \to Z^2 \to \cdots \to Z^n \to \cdots$ and in general the direct limit of this diagram does not exist in the category of schemes. (It does exist however in the category of formal schemes). Knutson's Algebraic Spaces, Chapter 5, section 1 (near the end) explains this well (for algebraic spaces, but for this point it is fine to think of everything as a scheme). 
A simple example is P^1 over a dvr (R,t), with Z the closed subscheme of P^1 defined by t. 
A: Edit: BCnrd gave a proof in the comments that this example works, so I've edited in that proof.
A possible proven example
I suspect There is no scheme which is "two $\mathbb A^1$'s glued together along their generic points" (or "$\mathbb A^1$ with every closed point doubled"). In other words, the coequalizer of the two inclusions $Spec(k(t))\rightrightarrows \mathbb A^1\sqcup \mathbb A^1$ does not exist in the category of schemes. Intuitively, this coequalizer should be "too non-separated" to be a scheme.
I don't have a proof, but I thought other people might have ideas if I posted this here.
If a coequalizer $P$ does exist, then no two closed points of $\mathbb A^1\sqcup \mathbb A^1$ map to the same point in $P$. To show this, it is enough to find functions from $\mathbb A^1\sqcup \mathbb A^1$ to other schemes which agree on the generic points but disagree on any other given pair of points. The obvious map $\mathbb A^1\sqcup \mathbb A^1\to \mathbb A^1$ separates most pairs of closed points. To see that a point on one $\mathbb A^1$ is not identified with "the same point on the other $\mathbb A^1$", consider the map from $\mathbb A^1\sqcup \mathbb A^1$ to $\mathbb A^1$ with the given point doubled.
On the other hand, let $U$ be an affine open around the image of the generic point in $P$. $U$ has dense open preimages $V$ and $V'$ in both affine lines. Let $W=V\cap V'$ inside the affine line, so we have two maps from $W$ to the affine $U$ which coincide at the generic point of $W$, and hence are equal (as $U$ is affine). In particular, the two maps from affine line to categorical pushout $P$ coincide at each "common pair" of closed points of the two copies of $W$, contradicting the previous paragraph.

Edit: The questions below are no longer relevant, but I'd like to leave them there for some reason.
Here are some questions that might be helpful to answer:

If the coequalizer above does exist, must the map from $\mathbb A^1\sqcup \mathbb A^1$ be surjective?

(see the related question Can a coequalizer of schemes fail to be surjective?)

Is the coequalizer of $Spec(k(t))\rightrightarrows \mathbb A^1\sqcup \mathbb A^1$ in the category of separated schemes equal to $\mathbb A^1$? (probably)

 

What are some ways to determine that a functor $Sch\to Set$ is not corepresented by a scheme?

A: This is not an answer to the question, but is intended to show that Martins's concern about the possible distinction between the colimit in the category of schemes vs. in the category of locally ringed spaces is a valid one.  Indeed, if I haven't blundered below, then it seems that in some circumstances at least the direct limit (colimit) of schemes exists, but does not coincide with the direct limit in the category of locally ringed spaces.
For example, suppose that $X_n$ is the Spec of $k[x]/(x^n),$ for some field $k$ (and the transition maps are the obvious ones). Then the direct limit of the $X_n$ in the category of locally ringed spaces is a formal scheme which is not a scheme, whose underlying topological space is a point, and whose structure sheaf (which is in this context simply a ring, namely the stalk at the unique point) is $k[[x]]$.
On the other hand, suppose given compatible maps from the $X_n$ to a scheme $S$. These must all map the common point underlying the $X_n$ to some point $s \in S$, which lies in some affine open Spec $A$.  Thus the maps from the $X_n$ factor through Spec $A$, and correspond to compatible maps $A \rightarrow k[x]/(x^n),$ i.e. to a map $A \rightarrow k[[x]].$  This in turn gives a map Spec $k[[x]] \rightarrow$ Spec $A\subset X,$ and so we see that the natural compatible maps from the $X_n$ to Spec $k[[x]]$ identify Spec $k[[x]]$ with the direct limit of the $X_n$ in the category of schemes.
EDIT: As is noted in a comment of David Brown's attached to his answer, this example
generalizes, e.g. if $I$ is an ideal in a ring $A$, then the direct limit in the category of schemes of Spec $A/I^n$ coincides with Spec $\hat A$, where $\hat A$ is the $I$-adic completion of $A$.  
FURTHER EDIT: I am no longer certain about the claim of the previous paragraph.  If $A/I$ (and hence each $A/I^n$) is local then for any scheme $S$ the maps Spec $A/I^n \to S$ factor through an affine open subscheme, so one reduces to computations in the category of rings, and hence finds that indeed the direct limit of the Spec $A/I^n$ equals Spec $\hat{A}$.  More generally, I'm currently unsure ... .
A: This answer is mainly in response to Matt Emerton's question above about whether a collection of maps $\operatorname{Spec} A/I^n \to X$ algebraizes to a map $\operatorname{Spec} \widehat{A} \to X$. The answer is indeed yes if $X$ is qcqs and is a result of Bhargav from 2014. Note that $A$ and $X$ need not be Noetherian!
A: Sounds to me like you don't want to hear the proof, but you want to hear "the point". The point is that a scheme must by definition be covered by affine schemes, and sometimes when doing exercises in Hartshorne the proofs go like this: first do the question for affine schemes, where the question becomes ring theory, and then do it for all schemes by glueing together. So here is how you might want to try and quotient out a scheme by a free action of $Z/2Z$: first let's say the scheme is affine, so $Spec(A)$, with $A$ having an action of $Z/2Z$, and try and figure out if the quotient exists, and then move onto the general case.
In the affine case we have a ring $A$ with an action of $Z/2Z$, and if $B$ is the invariants, then you can convince yourself that $Spec(B)$ is the quotient.
Now let' s do the general case. Say $X$ is a scheme with an action of $Z/2Z$. Choose a point $x$ in $X$. Now let $Spec(A)$ be an affine containing $x$. Now $Z/2Z$ acts on $Spec(A)\ldots$oh wait, no, no it doesn't, because the action will maybe move $Spec(A)$ to another affine $Spec(B)$. So let's try intersecting $Spec(A)$ and $Spec(B)$, The intersection will often be affine so let's consider this and call it $Spec(C)$ and$\ldots$oh no, wait, that doesn't work either, because $x$ might not be in $Spec(C)$. Hmm.
The well-known 3-fold you mention in your question behaves in this way. You can't cover it by affines each one of which is preserved by the action, so you get stuck.
Does that help?
A: Direct limits include in particular quotients.
I think that if $Z \subset X$ is a closed subscheme, then $X/Z$ usually doesn't exist.
Let's take for $Z$ a divisor on $X$, such that there exist a rational function $f: X \to \mathbb P^1$ with poles only on $Z$. Then according to the universal property of quotients such a function descends to a function $f \bar: X/Z \to \mathbb P^1$, with the pole consisting of one point (I'm little uncertain, why it's a point, but perhaps it must be a point). But that's impossible unless $dim(X)=1$.
