Solution (source code)

= Solution

The <fibre product of schemes> $X\times_SY$ comes with projections to $X$ and $Y$ having equal composites to $S$, and is universal with this property. A morphism is <universally closed morphism>[universally closed] when every base change is closed on underlying topological spaces.

The structural morphism $\mathbb A_k^1\to\operatorname{Spec}k$ is closed because its target has one point, but it is not universally closed. After base change by $\mathbb A_k^1$, it becomes the projection $\mathbb A_k^2\to\mathbb A_k^1$; the closed hyperbola $V(xy-1)$ has image $D(x)$, which is not closed.

For a finite-type universally closed nonseparated example, glue two copies of $\mathbb P_k^1$ along the complement of one rational point, producing a projective line with a doubled point. It is of finite type. After every base change, each of its two projective-line charts maps closedly to the base, so the image of any closed subset, being the union of the two closed images, is closed. Thus the structural morphism is universally closed. It is not separated because the two doubled points violate uniqueness in the <valuative criterion for separatedness>, or equivalently because its diagonal is not closed.