Let B be an open set contained in U closure. Let C be the intersection of B and the complement of U. If C is empty then B is in U. That's one way to put B in U closure.
assume C is nonempty. Let D be an open set in B, that is entirely contained in C. Now U closure misses D, and cannot contain all of B. Conversely, if U closure misses part of B, there must be an open set D that is sequestered in C. Thus U closure contains all of B iff the open sets in B are never in C.
In summary, U is nowhere dense iff each open set misses U, or includes a smaller open set that misses U. Note that a subspace of a nowhere dense set misses even more sets, and remains nowhere dense.
If the topology has a base, it is sufficient to refer to base sets in the above characterization. For instance, if the topology is a metric space, then U is nowhere dense iff every open ball contains another open ball that misses U.
The set U is first category, or meager, if it is a countable union of nowhere dense sets. The space S is first category if it is a first category set within itself.
A subspace of a first category set remains first category.
Since the countable union of countable sets is countable, the countable union of first category sets is first category.
The complement of a first category set is called residual.
If U is not first category it is second category. That's the definition.
If S is a complete metric space, as above, and S has no isolated points, then S, as a set, is uncountable. If S is countable then it is the countable union of its points. Remember that each point is closed in a metric space. If every point acts as a nowhere dense set then S becomes first category, which is a contradiction. Thus some point x fails to be a nowhere dense set. It's complement misses an open set, and that open set has to be x. If x is an open set then it is bounded away from the rest of S, and x is an isolated point.
The reals have no isolated points, and sure enough, they are uncountable.
Suppose the complement of U is not dense in S, hence U contains a nonempty open set O0. Replace O0 with an open ball inside O0. In other words, O0 has become a base set.
Let U1 be the first nowhere dense set inside U. Since U1 is nowhere dense, O0 contains a nonempty open ball O1 missing U1. Similarly O1 contains a nonempty open ball O2 missing U2, and so on. Choose ever smaller radii, so diameters approach 0, and make sure the closure of each open ball is entirely contained in the previous open ball. The centers approach some point x in the complete metric space S. Since x is in the closure of O1, x is in O0. Yet x is not in U1, or U2, or U3, etc, hence x is not in U. The complement of U intersects our arbitrary open set O0, and the complement of U is dense.