Consider the metric space $(X, d)$ given by $$X = \{\text{all continuous functions}\,f:[0,1]\to\Bbb R\}$$ with $$d(f,g)=\sup_{t\in[0,1]}|f(t)-g(t)|.$$ Find with proof a set $A \subseteq X$ with $\operatorname{diam} A < \infty$ which is not compact in $(X, d)$.
I can gather that $A$ must be infinite, because any finite set is compact. I can't however reconcile this with $\operatorname{diam} (A) < \infty$ (where diameter is defined as the supremum of all distances). I can't get the faintest picture in my head of what this would even look like, let alone a formal example.
Set $f_n(x):=\frac{1}{n}$ for every $x\in[0,1]$ and every $n\geq 1$. Then the set $A:=\{f_n\;;\;n\geq 1\}$ has $\mbox{diam}\;A\leq 1$. Since $f_n$ converges uniformly to $0$, $0$ is in the closure of $A$, but not in $A$. So $A$ is not closed. A fortiori not compact.
Note: this is probably the simplest example when $A$ is not required to be closed. But Davide Giraudo's example is more interesting. Indeed, from his example, you see that the closed unit ball of your space is not compact, as his sequence does not admit a converging subsequence. And of course, the closed unit ball is closed and bounded.