Solution (source code)

= Solution

Over an <affine open subscheme> $\operatorname{Spec}A$ of the target, a <closed immersion> has the form $\operatorname{Spec}(A/I)\to\operatorname{Spec}A$. Pulling it back along an <affine scheme> map $\operatorname{Spec}B\to\operatorname{Spec}A$ gives
$$
\operatorname{Spec}((A/I)\otimes_AB)\simeq\operatorname{Spec}(B/IB).
$$
The identification follows directly by tensoring the quotient presentation; it does not require $B$ to be flat over $A$. Since $B\to B/IB$ is surjective, this is again a <closed immersion>. These affine calculations cover every <base change of a morphism of schemes>.

\b[Being a <closed immersion> is stable under arbitrary <base change of a morphism of schemes>.]