$\def\emptyset{\varnothing}$Let $(X, \tau)$ be a topological space. Suppose that $\tau'$ is the collection of open subsets $U \subset X$ with respect to $\tau$ such that either $U=\emptyset$ or $U$ is dense in $X$ with respect to $\tau$.
I want to show that $\tau'$ defines a topology on $X$. To do this, I know that I must show four properties:
1) $\emptyset \in \tau'$
2) $X \in \tau'$
3) If $U_1,U_2, . . ., U_n \in \tau'$, then $\bigcap\limits^n_{i=1} U_i \in \tau'$
4) If $S$ is any nonempty set and for each $s \in S$, $U_s \in \tau'$, then $\bigcup\limits_{s\in S} U_s \in \tau'$.
I was able to complete the first three on my own, but I am struggling with the fourth one. I know that if $U_s \in \tau'$, then either $U_s = \emptyset$ or $U_s$ is dense in $X$ with respect to $\tau$. If $U_s = \emptyset$, it essentially contributes nothing to the union, so you really only need to consider the case where $U_s$ is dense in X with respect to $\tau$. By definition, for every nonempty open set $V \subset X$, $U_s \cap V \neq \emptyset$.
I want to eventually be able to show that $\bigcup\limits_{s\in S} U_s$ is dense in $X$ with respect to $\tau$. Any help on where to go from here would be greatly appreciated.
Let $V:=\bigcup_{s\in S} U_s$ for ease of notation. We may assume that there is a $t\in S$ such that $U_t\ne\emptyset$ otherwise, $V=\emptyset\in\tau'$. Since $U_t\ne\emptyset$ and $U_t\in\tau'$, we know that $U_t$ must be dense in $X$ by definition of $\tau'$, therefore the closure of $U_t$ is $X$.
Note now that $U_t \subseteq V\subseteq \overline{V}$, so $\overline{V}$ is a closed set containing $U_t$. Therefore, $\overline{V}$ must contain the closure of $U_t$, which is $X$. In summary, we have $X\subseteq\overline{V}\subseteq X$, hence $\overline{V}=X$, which means that $V$ is dense in $X$. Consequently, we have $V\in\tau'$ by definition.