An example of neither open nor closed set

$[0,1)$

It is not open because there is no $\epsilon > 0$ such that $(0-\epsilon,0+\epsilon) \subseteq [0,1)$.

It is not closed because $1$ is a limit point of the set which is not contained in it.


For a slightly more exotic example, the rationals, $\mathbb{Q}$.

They are not open because any interval about a rational point $r$, $(r-\epsilon,r+\epsilon)$, contains an irrational point.

They are not closed because every irrational point is the limit of a sequence of rational points. If $s$ is irrational, consider the sequence $\left\{ \dfrac{\lfloor10^n s\rfloor}{10^n} \right\}.$


Let $A = \{\frac{1}{n} : n \in \mathbb{N}\}$.

$A$ is not closed since $0$ is a limit point of $A$, but $0 \notin A$.

$A$ is not open since every ball around any point contains a point in $\mathbb{R} - A$.