How is the set X closed in X, if X is a union of basis elements, i.e. open sets and therefore must be open? If we have a topological space $X$ with some topology $\mathcal{T}$ and basis $\mathcal{B}$, we know that it must be the case that $X$ and $\emptyset$ are open in $X$, and therefore are also closed. Since $X$ is open, then it can be presented as a union of basis elements, which are also open sets in $X$. The union of open sets must be open, but $X$ is both - open and closed. So my question is, can an arbitrary union of open sets also be closed? Am I overlooking something? This just didn't seem ok from the first sight.
Also, now when I think about it, I am not sure how would open set - $\emptyset$ be presented as a union of basis elements. Do we necessarily include the empty set in $\mathcal{B}$? Or not all of the open sets can be presented as a union of basis elements? Or does the intersection of two basis elements, that have no overlap, take care of the empty set? (since every element in the intersection of two basis elements must be contained in a basis element contained in that intersection, so for $x \in B_1 \cap B_2 = \emptyset = B_3 \in \mathcal{B}$, or does this even not make sense, since I am talking about non-existent element?)
 A: A topological space is a pair $(S,T)$ where $T$ is a collection of some or all of the subsets of $S,$ such that
(i). $\emptyset\in T$ and $S\in T,$
(ii). $\cup V=\cup_{v\in V}\,v\in T$ for every $V\subset T,$
(iii). $\cap V=\cap_{v\in V}\,v\in T$ for every  $finite$ $ V\subset T.$
The members of $T$ are called open sets and their complements in $S$ are called closed sets. And $T$ is called a topology on $S.$
It is very common to speak of "the space $S$" when what is really meant is a space $(S,T).$
The definition is not very restrictive. It does not exclude the case where every subset of $S$ belongs to $T.$ This is called the discrete (or fine) topology on $S$. It does not exclude the case $T=\{\emptyset, S\}.$ This is called the coarse (or anti-discrete) topology on $S$. (I would like to call it the indiscrete topology.) In both of these topologies, any union of open sets is open-and-closed. (Some say clopen for open-and closed.)
It may be that no member of $W=T\setminus \{\emptyset,S\}$ is open-and-closed and that $\cup W=S$  so $\cup W$ is open-and-closed. For example when $S=\Bbb R$ and $T$ is the usual ("standard") topology on $\Bbb  R.$
