= Solution
A morphism $f:X\to S$ is a <separated morphism> when its <diagonal morphism>
$$
\Delta_{X/S}:X\longrightarrow X\times_SX
$$
is a <closed immersion>.
For the requested example, take the <affine plane with doubled origin>: glue two copies $U,V\cong\mathbb A_k^2$ by the identity on
$$
U\cap V\cong\mathbb A_k^2\setminus\{0\}.
$$
The opens $U$ and $V$ are affine, while their intersection is the <punctured affine plane>, which is not affine. Indeed, its regular functions are still $k[x,y]$; if it were affine, the canonical map to $\operatorname{Spec}k[x,y]=\mathbb A_k^2$ would be an isomorphism, contrary to the missing origin. The resulting scheme is not separated: in a separated scheme, the intersection of two affine opens is the inverse image of the closed diagonal inside their affine product and is therefore affine.
Back to article page