Non-trivial topology where only open sets are closed

The topologies with this property are precisely the ones that are derived from partitions of the underlying set $X$.

Specifically, let $\mathcal{P}=\{X_i\}_{i\in I}$ be a partition of $X$, and let $\tau$ be the collection of sets of the form $\cup_{i\in I_0}X_i$ for $I_0\subseteq I$. Then $\tau$ is a topology: the empty set corresponds to $I_0=\varnothing$, the set $X$ to $I_0=I$; the union of such sets corresponds to the family indexed by the union of indices, and the intersection to the intersection of the indices. Moreover, the complement of the set corresponding to $I_0$ is the set corresponding to $I-I_0$. Thus, $\tau$ has the desired property.

Now let $\tau$ be any topology on $X$ with the desired property. Define an equivalence relation on $X$ by letting $x\sim y$ if and only if for every $A\in \tau$, $x\in A$ if and only if $y\in A$. Trivially, this is an equivalence relation, and so induces a partition on $X$. I claim that $\tau$ is in fact, the topology induced by this partition as above.

Indeed, if $A\in \tau$, then $A=\cup_{x\in A}[x]$, where $[x]$ is the equivalence class of $x$. Trivially $A$ is contained in the right hand side, and if $y\in[x]$, then since $x\in A$ then $y\in A$, so we have equality.

Now, conversely, let $x\in X$ and look at $[x]$. I claim that $X-[x]$ lies in $\tau$. So see this, let $z\in X-[x]$. Then since $z\notin [x]$, there exists an open set $A_z\in \tau$ such that $z\in A_z$ but $x\notin A_z$ (and hence, $[x]\cap A_z=\varnothing$). Now, $\cup_{z\notin[x]}A_z$ is an open set, contains every element of $X-[x]$, and intersects $[x]$ trivially because each element in the union does. That is, this open set is $A-[x]$; but since the complement of every open set is open, and $A-[x]$ is open, then $[x]$ is open. Thus, $[x]\in\tau$.

We have then proven that every element of the partition induced by $\sim$ is open, and that every open set is a union of such elements of the partition. That is, the open sets are precisely the unions of elements of the partition $X/\sim$.


Added. The equivalence relation given in the second part can be defined in any topology, of course; and the proof that every open set is a union of equivalence classes and that the complement of an equivalence class is open, always hold. The only place where we used the hypothesis that all open sets are closed was to conclude the equivalence class itself was open. For example, in the standard topology for $\mathbb{R}$, the equivalence relation is the trivial one.


You can manufacture examples like this pretty easily. Let $A$ be any subset of $\mathbb{R}$. Put a topology on $\mathbb{R}$ with the following open sets: $$ \varnothing, A, \mathbb{R}-A, \mathbb{R}. $$ You can easily check that this always gives a topology, and a subset of $\mathbb{R}$ is open if and only if it is closed. This construction generalizes to any set $X$: there's nothing special about $\mathbb{R}$ here.