Example 28.7.2. Here is an example where scheme theoretic closure being $X$ does not imply dense for the underlying topological spaces. Let $k$ be a field. Set $A = k[x, z_1, z_2, \ldots ]/(x^ n z_ n)$ Set $I = (z_1, z_2, \ldots ) \subset A$. Consider the affine scheme $X = \mathop{\mathrm{Spec}}(A)$ and the open subscheme $U = X \setminus V(I)$. Since $A \to \prod _ n A_{z_ n}$ is injective we see that the scheme theoretic closure of $U$ is $X$. Consider the morphism $X \to \mathop{\mathrm{Spec}}(k[x])$. This morphism is surjective (set all $z_ n = 0$ to see this). But the restriction of this morphism to $U$ is not surjective because it maps to the point $x = 0$. Hence $U$ cannot be topologically dense in $X$.

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).