This is an example from Gathmann's notes on algebraic geometry. His definition of the dimension of a non-empty topological space is:
The dimension $\dim X\in N\cup\{\infty\}$ is the supremum over all $n\in N$ such that there is a chain $$\emptyset \ne Y_0 \subsetneq Y_1 \subsetneq Y_2 \subsetneq ... \subsetneq Y_n \subset X$$
of length $n$ of irreducible closed subsets $Y_1,Y_2, ..., Y_n$ of $X$.
Next he gave two examples: (a) If $X$ is a non-empty finite affine variety then $\dim X=0$. I can understand this since the chain would be $Y_0={a}$ for any point $a\in X$, and $X$ itself is reducible, so cannot be in the chain.
(b) General finite topological spaces need not have dimension $0$. For example, the set $X=\{a,b\}$ whose closed subsets are $\emptyset, \{a\}$, and $X$. It has dimension when since ${a}\subsetneq X$ is a chain of length $1$.
I don't understand part (b). Why is $X$ considered to be irreducible, hence in the chain here? I think $X$ can be written as the union of two closed sets $\{a\}$ and $\{b\}$, which means it is reducible.
Thank you for any help!
The set $\{b\}$ is not closed. So, whenever you write $X$ as a union of closed subsets, one of those sets will be $X$ itself.
As a nice exercise, you can try to generalise this example to get finite spaces of arbitrarily high dimension.