Cartesian product of schemes Given schemes $X,Y$, then what's the relation between $X\times_{\text{Spec}\mathbb{Z}}Y$ and the Cartesian product $X\times Y$? Can we identify them?
 A: I guess by the "Cartesian product" you mean the product as sets.
There is the canonical map (of schemes) from $X\times_{\operatorname{Spec}{\mathbb Z}}Y$ to $X$, which can be viewed as a map of the underlying sets. Same for the map from $X\times_{\operatorname{Spec}{\mathbb Z}}Y$ to $Y$.
These two maps then gives a map of sets $f:X\times_{\operatorname{Spec}{\mathbb Z}}Y\rightarrow X\times Y$.
However, the map $f$ is in general neither injective nor surjective.
This is easily seen from the following examples:

*

*$X = \operatorname{Spec}\mathbb Z[x]$, $Y = \operatorname{Spec}\mathbb Z[y]$, $X\times_{\operatorname{Spec}{\mathbb Z}}Y = \operatorname{Spec}\mathbb Z[x, y]$.
The map $f$ is then not injective: the image of the prime ideal $(x + y)$ is the same as the image of the prime ideal $(0)$.


*$X = \operatorname{Spec}\mathbb Z/2\mathbb Z$, $Y = \operatorname{Spec}\mathbb Z/3\mathbb Z$, $X\times_{\operatorname{Spec}{\mathbb Z}}Y = \operatorname{Spec}0$.
The map $f$ is then obviously not surjective, since $X\times_{\operatorname{Spec}{\mathbb Z}}Y$ is empty as a set.
A: Subject to all of these things existing, the product is exactly the fiber product over the final object. This may be proven by noting that both constructions satisfy the same universal property, so they are canonically isomorphic.
Compare the universal properties defining both constructions. We take as our setup $X,Y$ two objects with $Z$ the final object and $c_X:X\to Z,c_y:Y\to Z$ the canonical morphisms to the final object.


*

*Product: the product is the unique object $X\times Y$ equipped with morphisms $p_X:X\times Y\to X$ and $p_Y:X\times Y\to Y$ so that for any other object $Q$ with maps $f_X:Q\to X$ and $f_Y:Q\to Y$, there exists a unique morphism $f:Q\to X\times Y$.

*Fiber product over $Z$: the fiber product is the unique object $X\times_Z Y$ equipped with morphisms $p_X':X\times_Z Y \to X$ and $p_Y':X\times_Z Y \to Y$ so that for any other object $R$ with maps $g_X:R\to X$ and $g_Y: R\to Y$ so that $c_X\circ g_X = c_Y\circ g_Y$, there exists a unique morphism $g:R\to X\times_Z Y$.
We note that the condition $c_X\circ g_X=c_Y\circ g_Y$ is vacuously true since there is only one morphism $R\to Z$ by the definition of $Z$ being a final object. So we see that the universal property satisfied by the fiber product over the final object is the same universal property as that satisfied by the product. As the object satisfying a universal property must be unique up to unique isomorphism, we see that $X\times Y \cong X\times_Z Y$ in any category possessing both products, fiber products, and a final object. In particular, this is true in both sets and schemes.
