Solution (source code)

= Solution

Let $X\xrightarrow fY\xrightarrow gS$ be <morphisms of schemes>. Start with $u:\operatorname{Spec}K\to X$ and $v:\operatorname{Spec}D\to S$ satisfying $gfu=v|_{\operatorname{Spec}K}$.

For existence, first apply the extension condition for $g$ to $fu$ and $v$, obtaining $w:\operatorname{Spec}D\to Y$. Then apply the extension condition for $f$ to $u,w$, obtaining $\ell:\operatorname{Spec}D\to X$. This $\ell$ solves the problem for $gf$. If both $f,g$ are <universally closed morphisms>, both are <quasi-compact morphisms>; their composite is a <quasi-compact morphism> by the allowed stability fact. Part (a)(i) therefore proves that $gf$ is a <universally closed morphism>.

For uniqueness, suppose $\ell_1,\ell_2$ are extensions for $gf$. Uniqueness for $g$ gives $f\ell_1=f\ell_2=w$, and uniqueness for $f$, now over this same $w$, gives $\ell_1=\ell_2$. If $f,g$ are <separated morphisms>, their composite is a <quasi-separated morphism> by the allowed stability fact. Part (a)(ii) proves that $gf$ is a <separated morphism>.

Finally, if $f,g$ are <proper morphisms>, these arguments give both existence and uniqueness. Stability under composition of <quasi-compact morphisms>, <quasi-separated morphisms> and <locally of finite type> gives the other hypotheses of (a)(iii). Consequently
$$
\boxed{\begin{aligned}
f,g\text{ universally closed}&\Longrightarrow gf\text{ universally closed},\\
f,g\text{ separated}&\Longrightarrow gf\text{ separated},\\
f,g\text{ proper}&\Longrightarrow gf\text{ proper}.
\end{aligned}}
$$