# Separatedness of open subscheme of affine schemes

A scheme $$X$$ is separated if the daiganoal morphism $$\Delta:X \rightarrow X \times_{\Bbb Z} X$$ is a closed immersion. I know how to show that all affine schemes are separated. So

Are open subschemes of affine schemes separated? If not, what is an example?

For example, I would be interested to know if the open subscheme $$D= Spec\, k[x.y] \setminus \{0\} \rightarrow Spec \,k[x.y]$$ is separated.

Let $$U$$ be an open subscheme of X. Base change $$X\to X\times_\mathbb{Z}X$$ by the map from $$U\times_\mathbb{Z}U$$ induced by the inclusion $$U\to X$$. The fiber product is just $$U$$, and the induced morphism is the diagonal of $$U$$. Since closed immersions are stable under base change, $$U$$ is also separated.