Prove that set $[2,3]$ is both open and closed and $(4,5)$ is also both open and closed in given metric space Let $A = [2,3] \cup (4,5)$ be set and $d(x,y) = |x - y|$ given metric.
a) Prove that set $[2,3]$ is both open and closed and $(4,5)$ is also both open and closed in A.
b) Is A compact?
My work:
a) $S = [2,3]$ is closed in A because for every sequence in S which converges to some $s_{\infty} \in A$ its true that $s_{\infty} \in S$. Now we can say that $(4,5)$ is open in A because its complement is closed. Same logic, $(4,5)$ is closed in A because only "problematic" points can be $4$ and $5$, but A does not contains these points. And finally, $[2,3]$ is open in A because its complement is closed.
Is this way of thinking alright? If not, can someone provide me correct proof without using connectivity.
b) Using this: "Subspace of compact space is compact iff it is closed", we can say that A is not compact because in $\mathbb{R}$ it is not closed.
I am not sure if this is okay. Can someone please check it?
 A: Your ideas are good and can work with some minor changes.
a) In $A$, one has $[2,3] = B(2;\frac{3}{2})$ (the open ball of centre $2$ and radius $\frac{3}{2}$).
Similarly, $(4,5) = B(\frac{9}{2};1)$ (the open ball of centre $\frac{9}{2}$ and radius $1$).
It follows that both are open, as open balls.
Since they are each other's complementary in $A$, they are also closed.
b) Your argument fails to work since $\Bbb R$ is not compact.
However, you can adapt this argument, since $A\subset [2,5]$ and $[2,5]$ is indeed compact.
A: your reasoning in a. is correct.
I would like to add that the topology is defined here as:
$\{\emptyset, A, [2,3],(4,5)\}$ with the usual metric inherited from $R$
You can check that the members of this topology satisfy the union and intersection properties.
Thus, simply said $[2,3]$ is closed in the usual metric.
Thus, it's complement $(4,5)$ is open.
As for b.
it is not compact since it is not sequentially compact in $(4,5)$, remember this is a metric space.
Also, since $[2,3]$ is a member of the toplology it is also open and it's complement $(4,5)$ is closed.
