Topology on $\mathbb{R}$ with certain property I am trying to find a topology on $\mathbb{R}$ that is not discrete or indiscrete, where every open set is closed.
My idea was the topology $T$ generated by $\{ (k,k+1):\;k\in \mathbb{Z}\}\cup \{ [k,k+1]:\;k\in \mathbb{Z}\}$
This gives us all possible intervals (including the degenerate ones) with either integer or infinite endpoints, and their unions. My train of thought was that the complement of anything in $T$ is also in $T$, so open sets are closed. Does that work? If so, are there nicer examples?
 A: Fix $A\subseteq\Bbb R$ and consider $\tau_A=\{\varnothing,\Bbb R,A,\Bbb R\setminus A\}$.
If $A\neq\varnothing$ and $A\neq\Bbb R$ you get a nontrivial example.
A: Yes, your example works; it can be described more simply as the topology generated by the base
$$\big\{(k,k+1):k\in\Bbb Z\big\}\cup\big\{\{k\}:k\in\Bbb Z\big\}\;.\tag{1}$$
Asaf has given one recipe for creating simple examples; here’s another. Let $A$ be any non-empty, proper subset of $\Bbb R$; then the topology generated by the base
$$\{\Bbb R\setminus A\}\cup\big\{\{a\}:a\in A\big\}\tag{2}$$
is an example. In fact the topology can be described fairly easily: it’s
$$\wp(A)\cup\{\Bbb R\setminus S:S\subseteq A\}\;.$$
That is, the open sets are the subsets of $A$ and the sets that contain $\Bbb R\setminus A$.
The most general approach is to let $\mathscr{P}$ be any partition of $\Bbb R$. Then $\mathscr{P}$ is a base for a topology $\tau_{\mathscr{P}}$ in which every open set is closed. (You should prove this.) If $\mathscr{P}=\big\{\{x\}:x\in\Bbb R\big\}$, then $\tau_{\mathscr{P}}$ is the discrete topology on $\Bbb R$, and if $\mathscr{P}=\{\Bbb R\}$, then $\tau_{\mathscr{P}}$ is the indiscrete topology on $\Bbb R$.


*

*Your example corresponds to letting $\mathscr{P}$ be the partition in $(1)$ above.  

*Asaf’s corresponds to $\mathscr{P}=\{A,\Bbb R\setminus A\}$.  

*And mine corresponds to letting $\mathscr{P}$ be the partition in $(2)$ above.


It’s actually possible to show that these topologies are the only ones with the desired property. To do so, let $\tau$ be such a topology. Note first that if every open set is closed, then every closed set is open. (Why?) For $x\in\Bbb R$ let 
$$C(x)=\bigcap\{U\in\tau:x\in U\}\;;$$
$C(x)$ is an intersection of open sets, so it’s an intersection of closed sets and is therefore closed and hence also open. Now let $y\in\Bbb R\setminus C(x)$. Then $\Bbb R\setminus C(x)$ is an open nbhd of $y$, so $C(y)\subseteq\Bbb R\setminus C(x)$, i.e., $C(x)\cap C(y)=\varnothing$. What if $y\in C(x)$? Then clearly $C(y)\subseteq C(x)$, so $C(y)\cap C(x)\ne\varnothing$, and therefore $x\in C(y)$ and hence $C(x)\subseteq C(y)$, i.e., $C(x)=C(y)$. Thus, $\mathscr{C}=\{C(x):x\in\Bbb R\}$ is a partition of $\Bbb R$, and it’s easy to check that $\tau=\tau_{\mathscr{C}}$.
