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.
Here's my idea (feel free to criticize):
if $a = b$, then $(a,b) = \emptyset$ which means $\overline{(a,b)} = \emptyset \neq [a,b] = \{a \}$.
But if $a \neq b$, you could still have $(a,b) = \emptyset$ if there is no $z \in X$ with $a < z < b$.
So, what we really want is for there to exist $z \in X$ such that $a < z < b$ (note that this implies $a \neq b$). But then, if $a$ is not the smallest element of $X$, and there is only one $z$ such that $a < z < b$, then we would have an open neighborhood around $a$ (namely, $(a', z)$ where $a' < a$) such that the neighborhood doesn't intersect $(a,b)$, which would mean $a$ is not a limit point of $(a,b)$...
I think what we need is the ability to always find a point between two points in the space, that is, if $x, y \in X$ we need to be able to find $z \in X$ such that $x < z < y$.