Is $[a,b] \subset B$ necessarily true? I am currently working on a problem, and in order to continue, I need to first make sure if the following statement is true:
Suppose I have a set $A$ which is dense in the interval $[a,b]$. Now let $B$ be a closed set with $A \subseteq B$. Is it necessarily true that $[a,b]\subseteq B$?
My thinking is yes, but I’m struggling to convince myself why it is true. Can anyone please give me an indication if this is true and why?

Denote the complement of $B$ by $B^c$
Suppose that $[a,b] \not\subseteq B$. Then there exists a point $x \in [a,b]$ with $x \in B^c$. Since $B^c$ is open, there exists an open interval $I$ with $x \in I \subset B^c$.
Since $A$ is dense in $[a,b]$ and $x \in [a,b]$, the interval $I$ must contain a point of $A$. This implies $A \cap B^c \not= \emptyset$, contrary to hypothesis.
