TITLE: Does the inclusion from affine schemes into schemes preserve pushouts?
QUESTION [6 upvotes]: Let $K$ be a field.

What is an example of two $K$-algebra morphisms $R\to T$ and $S\to T$ such that $\operatorname{Spec}(R\times_T S)$ is not the pushout of the diagram
  $$
\operatorname{Spec}(S)\leftarrow\operatorname{Spec}(T)\rightarrow\operatorname{Spec}(R)
$$
  in the category of schemes? Does an example exist with $R$, $S$, $T$ finitely generated? Does an example exist with $R$, $S$, $T$ and $R\times_T S$ finitely generated?

In particular, the exisitence of such an example would prove that the inclusion functor from affine schemes into schemes does not preserve pushouts.

REPLY [10 votes]: The functor $\textrm{Spec} : \textbf{CRing}^\textrm{op} \to \textbf{Sch}$ does not preserve pushouts, and this is intentional.  Indeed, consider the projective line $\mathbb{P}^1_k$ over a field $k$. This is obtained by gluing two copies of $\mathbb{A}^1_k$ along $X = \mathbb{A}^1_k \setminus \{ 0 \}$, and in fact we have a pushout diagram in $\textbf{Sch}$:
$$\tag{1} \begin{array}{ccc}
X & \to & \mathbb{A}^1_k \\
\downarrow & & \downarrow \\
\mathbb{A}^1_k & \to & \mathbb{P}^1_k
\end{array}$$
Applying the global sections functor to this diagram, we get a pullback diagram in $\textbf{CRing}$:
$$\tag{2} \begin{array}{ccc}
k & \to & k[t^{-1}] \\
\downarrow & & \downarrow \\
k[t] & \to & k[t, t^{-1}]
\end{array}$$
However, if we apply $\textrm{Spec}$ to diagram (2) we do not get back to diagram (1) because $\mathbb{P}^1_k$ is not affine. So we have the desired counterexample.

REPLY [3 votes]: For a simple example where the pushout of affine schemes is not preserved by the inclusion to schemes, see my answer to https://mathoverflow.net/questions/29311 .