example of a set that is closed and bounded but not compact 
Find an example of a subset $S$ of a metric space such that $S$ is closed and bounded but not compact.

One such example that comes from analysis is probably a closed and bounded set in $C[0,1]$. I attempt to construct my own example to see if it works.
Is $\{ \frac{1}{n} | n \in \mathbb{N} \}$ endowed with discrete topology a set that is closed and bounded but not compact? My guess is that it is indeed an example of closed and bounded does not imply compact.
Every element is less than or equal to $1$, and it is closed  as a whole set. If we let $\mathcal{A}$ be a covering of the set that consists of singletons in $\{ \frac{1}{n} \}$ so that any finite subcover 
$\{ \frac{1}{n_j} |j =1,...,k \quad \text{and} \quad n_j \in \mathbb{N} \}$ will not cover $\{\frac{1}{n}\}$, because if we take $n = \max \{{n_j}\}, \frac{1}{n+1}$ is not in the finite subcover.
Thanks in advance for pointing out any mistake.
 A: Yes, if the metric space $X$ is unbounded take the complement of any bounded open set. For example $X$ itself which is the complement of the bounded open set $\emptyset$.
P.S. For your edited question, then $X$ has to be infinite-dimensional. If $X$ is a infinite-dimensional Banach space then any closed ball of positive radius is closed, bounded but not compact. 
A: In any infinite-dimensional Hilbert space $\mathcal{H}$ the closed unit ball $B(0,1)$ is closed but not compact (for the norm-topology).
*By $B(0,1)$  I mean the set $\{x\in\mathcal{H}: \ \Vert x\Vert_{\mathcal{H}}\leq 1\}$.
Note that for your edited question my previous answer still works. For any $y\in\mathcal{H}$ and any $r>0$ all the closed balls $B(y,r)=\{x\in\mathcal{H}:\ \Vert x-y\Vert\leq r\}$ are closed but not compact (as soon as $\mathcal{H}$ is infinite-dimensional). 
A: Consider any infinite set $X$ with the metric $$d(x, y) = \begin{cases} 1 & x \neq y \\ 0 & x = y \end{cases} $$
This is called the discrete metric. Note that any $E \subseteq X$ is closed, open, and bounded, including $X$ itself. But $X$ is not compact. The open cover $\{ \{x\} : x \in X \}$ of $X$ by singletons had no finite subcover. Thus $X$ is not compact.
A: A metric space where closed, bounded $\iff$ compact is said to have the Heine-Borel property.  $\mathbb R^n$ with euclidean metric all have Heine-Borel property.
(Possibly) The easiest counter example of a metric space without the HB property, is probably $\mathbb Q^n$ as a euclidean metric space which, unlike $\mathbb R^n$ is not complete.
For example:  Consider $[1,\sqrt 2]\cap \mathbb Q = \{q\in \mathbb Q| q \ge 1; q^2 \le 2\}$.  In the metric space, $\mathbb Q$, this set is closed for the same reason $[1, \sqrt 2]$ is closed in $\mathbb R$.  And it is bounded.
But it is not compact for the same reason $[1, \sqrt 2)$ is not compact in $\mathbb R$.  (Note:  $[1,\sqrt 2)\cap \mathbb Q = [1,\sqrt 2]\cap \mathbb Q$.)
(If you need more.  $\{(.9, \sqrt 2 -\frac 1n)\cap \mathbb Q|n\in \mathbb N\}$ is an open cover of $K =[1,\sqrt 2)\cap \mathbb Q = [1,\sqrt 2]\cap \mathbb Q$.  It has not finite sub cover.  This fails in $\mathbb R$ for $[1,\sqrt 2]$ because none of these open sets contain $\sqrt 2$.)
(And if you need to know why $K$ is closed in $\mathbb Q$.  Well, $\sqrt 2$ can't be a limit point as $\sqrt 2$ does not exist in $\mathbb Q$.)
It might be interesting to note that in $\mathbb R$ the only sets that are both open and closed are $\mathbb R$ and $\emptyset$.  But $\mathbb Q$ as a metric space, for any irrational $a,b: a < b$, that $[a,b]\cap \mathbb Q=(a,b)\cap \mathbb Q = \{q\in \mathbb Q| a < q < b\}$ are all both open and closed.
.....
A more complex space without the HB property is an infinite dimensional Banach space.  Infinite dimensions make a difference. As does lake of completeness.
....
When I said "easiest" I did forget about the discrete metric, as per AJYs terrific answer.
In the discrete metric space every set is both open and closed and as maximum distance is $1$ all sets are bounded.  And a singleton set of a single element is an open set.  So every set will have an open cover of singletons covering it and this cover will have no subcover.  So no infinite set is compact but all sets are closed and bounded.
That's arguably "easier" than $\mathbb Q^n$.... or maybe it isn't.
A: $A=[0;1]∩\mathbb{Q}$ is bounded, closed in $\mathbb{Q}$ but not complete,as $\mathbb{Q}$ is dense in $\mathbb{R}$, so $A$ is not compact.
A: If $\{e_n\}$ is an (infinite) orthonormal set in  a Hilbert space $H$ then  $\{e_1,e_2,...\}$ is closed and bounded but not compact. It is not compact because there is no convergent subsequence (since $\|e_n-e_m\|=\sqrt2$ for $n \neq  m)$.
A: You're on the right track. If we consider $X=\left\{\frac1n:n\in\Bbb N^+\right\}$ in the discrete topology, then we can endow it with the metric $d:X\times X\to\Bbb R$ given by $$d(x,y)=\begin{cases}0 & x=y\\1 & \text{otherwise,}\end{cases}$$ which does indeed induce the discrete topology on $X$ (it's called the discrete metric for this reason). Then $X$ is certainly bounded, as any ball of radius greater than $1$ necessarily includes the whole set, and is certainly closed in itself (as all spaces are). However, it is not compact, since the open cover by singletons admits no finite subcover, as you've observed. More generally, any infinite discrete space admits a proper subspace that is closed and bounded, but not compact (delete any point).
We could come to the same conclusions if we considered $X$ as a space under the metric $$\rho(x,y)=|x-y|.$$ Indeed, $\rho$ induces the discrete topology on $X$, as well, and we similarly find that $X$ is bounded under $\rho$.
The kicker, here, is the boundedness. You need to specify a metric, or some other convention to determine boundedness, not just a topology. For example, $\Bbb Z$ considered as a subspace of $\Bbb R$ is indeed discrete, but while it is bounded in the discrete metric, it is not bounded in the standard metric on $\Bbb R$.
A: The "closed" ball $\lVert x \rVert \leq 1$ in any infinite dimensional Banach space is closed and bounded but not compact. It is closed because any point outside it is contained in a small open ball disjoint from the first one, by the triangle inequality. That is, if $\lVert y \rVert = 1 + 2 \delta,$ then the sets $\lVert x \rVert \leq 1$ and $\lVert x - y \rVert <  \delta$ are disjoint. Hence the complement of the "closed" unit ball is open and the  "closed" unit ball really is closed. But not compact if not in finite dimensions.
A: Let $X$ be a non compact metric space. Then $X$ is closed but not compact.
