Munkres Topology Question article 17 problem 5

Indeed $[a,b]$ (assuming $a < b$, both in $X$) is always closed, as $$X \setminus [a,b] = \{x \in X: x < a \} \cup \{x \in X: x > b\}\;,$$ and by definition, both the sets on the right hand side are open. So that part is correct.

$a \in X$ has a right neighbour iff there exists some element $y \in X$ such that $a,y$ and $(a,y) = \emptyset$; this $y$ is then often denoted $a^{+}$. We define a left neighbour $a^{-}$ similarly (so that $a^{-}<a$ and $(a^{-},a) = \emptyset$). Of course in some ordered sets, no right or left neighbours exist, like in the reals, or the rationals. In others, both exist (like in $\mathbb{Z}$), and in a set like $[0,1] \cup [2,3]$, 1 is the left neighbour of 2 etc.

I claim that $a \in \overline{(a,b)}$ iff $a$ has no right neighbour.

Proof: Suppose $a$ has no right neighbour. Let $O$ be an open subset that contains $a$. If $a$ is the minimum of $X$ (if it exists) this means that for some $y > a$ we have that $[a, y) \subseteq O$, and if $a$ is not minimal we have $z < a$ and $y > a$ such that $(z,y) \subseteq O$. In either case, define $y' = \min(y,b)$, the $y' > a$ and so $(a,y') \neq \emptyset$, which means that $O \cap (a,b) \neq \emptyset$, and so $a \in \overline{(a,b)}$. On the other hand, if $a$ does have a right neighbour $a^{+}$, $\{x \in X: x < a^{+}\}$ is open in $X$, and does not intersect $(a,b)$ (as a point in it would contradict $(a,a^{+}) = \emptyset$), so $a \notin \overline{(a,b)}$. So we have equivalence.

Similarly, $b \in \overline{(a,b)}$ iff $b$ has no left neighbour. So we have equality of $\overline{(a,b)}$ and $[a,b]$ iff $a$ has no right neighbour and $b$ has no left neighbour.