Please skip this proof. It is more important to learn how to work with the fibre product which is explained in the next section. \medskip\noindent By Lemma \ref{lemma-morphism-into-affine} the scheme $\Spec(\mathbf{Z})$ is a final object in the category of locally ringed spaces. Thus it suffices to prove that fibred products exist. \medskip\noindent Let $f : X \to S$ and $g : Y \to S$ be morphisms of schemes. We have to show that the functor \begin{eqnarray*} F : \Sch^{opp} & \longrightarrow & \textit{Sets} \\ T & \longmapsto & \Mor(T, X) \times_{\Mor(T, S)} \Mor(T, Y) \end{eqnarray*} is representable. We claim that Lemma \ref{lemma-glue-functors} applies to the functor $F$. If we prove this then the lemma is proved. \medskip\noindent First we show that $F$ satisfies the sheaf property in the Zariski topology. Namely, suppose that $T$ is a scheme, $T = \bigcup_{i \in I} U_i$ is an open covering, and $\xi_i \in F(U_i)$ such that $\xi_i|_{U_i \cap U_j} =  \xi_j|_{U_i \cap U_j}$ for all pairs $i, j$. By definition $\xi_i$ corresponds to a pair $(a_i, b_i)$ where $a_i : U_i \to X$ and $b_i : U_i \to Y$ are morphisms of schemes such that $f \circ a_i = g \circ b_i$. The glueing condition says that $a_i|_{U_i \cap U_j} =  a_j|_{U_i \cap U_j}$ and $b_i|_{U_i \cap U_j} =  b_j|_{U_i \cap U_j}$. Thus by glueing the morphisms $a_i$ we obtain a morphism of locally ringed spaces (i.e., a morphism of schemes) $a : T \to X$ and similarly $b : T \to Y$ (see for example the mapping property of Lemma \ref{lemma-glue}). Moreover, on the members of an open covering the compositions $f \circ a$ and $g \circ b$ agree. Therefore $f \circ a = g \circ b$ and the pair $(a, b)$ defines an element of $F(T)$ which restricts to the pairs $(a_i, b_i)$ on each $U_i$. The sheaf condition is verified. \medskip\noindent Next, we construct the family of subfunctors. Choose an open covering by open affines $S = \bigcup\nolimits_{i \in I} U_i$. For every $i \in I$ choose open coverings by open affines $f^{-1}(U_i) = \bigcup\nolimits_{j \in J_i} V_j$ and $g^{-1}(U_i) = \bigcup\nolimits_{k \in K_i} W_k$. Note that $X = \bigcup_{i \in I} \bigcup_{j \in J_i} V_j$ is an open covering and similarly for $Y$. For any $i \in I$ and each pair $(j, k) \in J_i \times K_i$ we have a commutative diagram $$ \xymatrix{     & W_k \ar[d] \ar[rd] &   \\ V_j \ar[rd] \ar[r] & U_i \ar[rd] & Y \ar[d] \\     & X \ar[r]  & S } $$ where all the skew arrows are open immersions. For such a triple we get a functor \begin{eqnarray*} F_{i, j, k} : \Sch^{opp} & \longrightarrow & \textit{Sets} \\ T & \longmapsto & \Mor(T, V_j) \times_{\Mor(T, U_i)} \Mor(T, W_k). \end{eqnarray*} There is an obvious transformation of functors $F_{i, j, k} \to F$ (coming from the huge commutative diagram above) which is injective, so we may think of $F_{i, j, k}$ as a subfunctor of $F$. \medskip\noindent We check condition (2)(a) of Lemma \ref{lemma-glue-functors}. This follows directly from Lemma \ref{lemma-fibre-product-affine-schemes}. (Note that we use here that the fibre products in the category of affine schemes are also fibre products in the whole category of locally ringed spaces.) \medskip\noindent We check condition (2)(b) of Lemma \ref{lemma-glue-functors}. Let $T$ be a scheme and let $\xi \in F(T)$. In other words, $\xi = (a, b)$ where $a : T \to X$ and $b : T \to Y$ are morphisms of schemes such that $f \circ a = g \circ b$. Set $V_{i, j, k} = a^{-1}(V_j) \cap b^{-1}(W_k)$. For any further morphism $h : T' \to T$ we have $h^*\xi = (a \circ h, b \circ h)$. Hence we see that $h^*\xi \in F_{i, j, k}(T')$ if and only if $a(h(T')) \subset V_j$ and $b(h(T')) \subset W_k$. In other words, if and only if $h(T') \subset V_{i, j, k}$. This proves condition (2)(b). \medskip\noindent We check condition (2)(c) of Lemma \ref{lemma-glue-functors}. Let $T$ be a scheme and let $\xi = (a, b) \in F(T)$ as above. Set $V_{i, j, k} = a^{-1}(V_j) \cap b^{-1}(W_k)$ as above. Condition (2)(c) just means that $T = \bigcup V_{i, j, k}$ which is evident. Thus the lemma is proved and fibre products exist.