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=\lbrace1/n, n\in N\rbrace$ is this closed? To prove it is not compact take an open cover of $X_n=(1/n,1/2)$ now it doesn't have finite subcover, why?
Simply take the whole $\mathbb R$. It is closed and bounded, but not compact. For instance, the sequence $1,2,3,\ldots$ has no convergent subsequence. Here, I am using the fact that a metric space is compact if and only if every sequence of elements of that space has a convergent subsequence.