Which metric spaces are totally bounded? A subset $S$ of a metric space $X$ is totally bounded if for any $r>0$, $S$ can be covered by a finite number of $X$-balls of radius $r$.
A metric space $X$ is totally bounded if it is a totally bounded subset of itself.
For example, bounded subsets of $\mathbb{R}^n$ are totally bounded.
Are there any interesting necessary and/or sufficient conditions for a metric space or its subsets to be totally bounded?
[Background: I was trying to generalize problem 4.8 of baby Rudin which asks you to prove that a real uniformly continuous function on a bounded subset $E$ of the real line is bounded. It seems after a little googling that a more general true statement would require $E$ to be a totally bounded subset of some metric space. But where might we meet such subsets?]
 A: A metric space is totally bounded if and only if its completion is compact.  (However, a little googling reveals that totally bounded doesn't necessarily imply compact completion without the axiom of choice.)  This gives one explanation of the result in your background, because uniformly continuous functions extend to completions. 
For subsets of a complete metric space, total boundedness is equivalent to having compact closure, which is what we see for bounded subsets of $\mathbb{R}^n$.
I don't know, is this interesting?
A: The question asked "where we might meet" total boundedness.   One situation where you do not meet it is classical analysis or geometry in finite-dimensional spaces; in $R^n$, bounded and totally bounded are equivalent concepts.   So the intuition and conditions for appearance are necessarily more subtle.
Geometrically, a space fails to be totally bounded if and only if it contains an infinite set of points with all pairwise distances at least $d$ for some $d > 0$.  This is just the negation of the definition of totally bounded: if for some $\epsilon > 0$ there is no finite set of points whose $\epsilon$-neighborhood covers the space, then we can build an infinite set of mutually $\epsilon$-separated points by placing in the set  any point $p_1$ and for $n>1$ inductively adding to the set any point $p_n$ not inside the $\epsilon$-neighborhood of the preceding points.  For finite-dimensional spaces this can happen only for a sequence of points that escapes to infinity.  But in infinite dimensions an infinite set of $d$-separated points can be packed into a ball of finite radius.
Boundedness and total boundedness are both properties of the completion of the space.  A metric space has either boundedness property if and only if its completion does. Considering complete metric spaces is convenient because total boundedness (for a complete metric space) is equivalent to the space being compact.  So one might want a topological characterization of the difference between bounded and totally bounded, for complete spaces.  However, any metric space can be converted into a bounded one (without affecting total boundedness, completeness, or the topology) by replacing the metric $d$ with $d/(1+d)$ or some other bounded monotonic function that preserves the property of being a metric.  So topological characterization suitable for understanding the difference between bounded and totally bounded (complete) spaces is more elusive. Maybe one should consider uniform spaces instead. 
Returning to the question of situations where total boundedness appears, there are at least two:


*

*As far as total boundedness requires infinite-dimensionality and a metric, it comes up naturally in functional analysis.

*It also appears in so-called "constructive analysis", i.e., analysis using direct and generally negation-free arguments, as in Errett Bishop's book.   The concept of total boundedness first arose from a (classical) logical analysis of the Heine-Borel theorem and what was required to extend it to general metric spaces.   In a situation where nonconstructive arguments, such as determining whether a given sequence has infinitely many positive terms, are not present, spaces like the real numbers are not all that different from general metric spaces, and an analysis of which hypotheses were "really at work" in the classical proofs is useful for building the theory in the more general and direct fashion that Bishop advocated.  So where boundedness might be used in a finite-dimensional classical argument, one might use total boundedness in the constructive one.  This is similar in flavor to the question above in the comments, of what characterizations are true without the axiom of choice.
A: A metric space is totally bounded if and only if every sequence has a Cauchy subsequence.
(Try and prove this!)
As you might suspect, this is basically equivalent to what Jonas has said.  The key between these two is provided by:
A metric space is compact if and only if it is totally bounded and complete.
In other words, every sequence has a convergent subsequence (compact) if and only if every sequence has a Cauchy sequence (Totally bounded) and every Cauchy sequence converges (complete).
