Prove or counterexample: A closed and totally bounded set $A$ in a metric space must be compact. I think for some time and now I agree that the statement is false. But I cannot prove or disprove the statement.
I know that compact $\Leftrightarrow$ complete+totally bounded, and also "bounded and totally bounded are the same in $\Bbb R^n$".
So I aim to find a not complete metric space which is closed and totally bounded. Could someone please help? If such an example exists, may I please ask for finding one in $\Bbb R^n$ (or other easy examples are also appreciate).
If the statement is correct, may I please ask for a proof?
 A: Statement in your question is correct if you replace "metric space" by "$\mathbb{R}^n$" and this is precisely content of the Heine-Borel theorem.
A: Here's something you should try to prove:

If $A$ is a closed subset of a complete metric space $(X,d),$ then letting $d'$ be the restriction of $d$ to $A\times A,$ we have that $(A,d')$ is a complete metric space.

It isn't too tricky. Consequently, a closed, totally bounded subset of a complete metric space will be compact, so if you're looking for counterexamples, you shouldn't look in euclidean spaces or other complete metric spaces.
The comments give a nice example of a closed, totally bounded subset of $\Bbb Q$ that does the trick, though.
A: If you want $Y=\overline Y\subset X$ where   $Y$ is  totally bounded but not compact, then, as pointed out in the Answer by Cameron Buie, $d$ cannot be a complete metric on $X.$  So in particular we cannot have $X=\mathbb R^n$ with the usual metric.
However we may take $Y=X$ if $d$ is an incomplete metric on $X$ and $(X,d)$ is a totally bounded metric space. For example let $X$ be the real interval $(0,1)$ with $d(u,v)=|u-v|. $
