In learning about connected metric spaces, I came across the definition that a metric space $X$ is not connected if there exists an open and closed subset of $X$.
In the above example, I can think of two reasons why $[0,1]$ is both open and closed but I don't know which is the corrected interpretation.
1) $[0,1]$ is an open subset with respect to $\mathbb{R}$ but a closed subset with respect to $X$. This shows it is both open and closed.
2) $[0,1]$ is closed in $X$ $\implies$ $[2,3]$ is open. But we also have that $[2,3]$ is closed in $X$ $\implies$ $[0,1]$ is open. Hence, $[0,1]$ is both open and closed.
Are either of these the correct interpretation? Which one is wrong and why?
(2) is correct, but (1) is not -- the set $[0,1]$ is certainly not open in $\mathbb R$.
Both of these intervals are open in $X$ because they each are the union of open balls (in $X$!) of radius $1$ about each of their points. Both are also closed in $X$, each being the complement of an open set in $X$.