Let $X$ be a metric space with underlying set $\mathbb{R}$ and metric $d(x,y)=\min\{|x-y|,1\}$. We have to find a subset of $X$ which is closed and bounded but not compact.
My attempt:
Since $d(x,y)=\min\{|x-y|,1\}$ , it means every set is bounded. Now choose a subset $X_n=\lbrace \frac{1}{n}, n\in N\rbrace$ is this closed? To prove it is not compact take an open cover of $X_n=(\frac{1}{n},\frac{1}{2})$ now it doesn't have finite subcover, why?