# Seeing if an arbitrary subring or set is dense in the Zariski topology

In another question, it was suggested that I check if a certain subring of a ring was dense in the Zariski topology. The subring, however, was not an ideal, so I wasn't sure how to represent it in $$Spec(R)$$.

Is there a standard meaning for checking if an arbitrary subring, or an arbitrary set is dense in the Zariski topology? Do we just look at all prime ideals containing the set, even though it isn't an ideal?

A basic example would be to look at $$\Bbb Z$$ in $$\Bbb R$$. This is not an ideal, but we can look at prime ideals in $$\Bbb R$$ containing it anyway. If we do so in $$Spec(\Bbb R)$$, then $$\Bbb Z$$ looks the same as $$\Bbb R$$ in the spectrum (as there is only one ideal). Does this mean it is equivalent to $$\Bbb R$$ in the Zariski topology and hence closed?

Remember that $$\operatorname{Spec}$$ is a contravariant functor, so morphisms of commutative rings $$A\to B$$ turn in to maps $$\operatorname{Spec} B\to \operatorname{Spec} A$$. From here, you can look and see if the image of $$\operatorname{Spec} B$$ in $$\operatorname{Spec} A$$ is dense or not.
For your example of $$\Bbb Z\subset \Bbb R$$, we see that the corresponding morphism is a map $$\operatorname{Spec} \Bbb R \to \operatorname{Spec}\Bbb Z$$. Since $$\operatorname{Spec} \Bbb R$$ has a single point, $$(0)$$, and the inverse image of $$(0)\subset \Bbb R$$ is again $$(0)\subset \Bbb Z$$ (the generic point of $$\operatorname{Spec}\Bbb Z$$), we see that the image of this morphism is in fact dense. This is basically a baby example of something that happens lots of places - dominant maps of affine schemes correspond to injective maps on coordinate rings.