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?