Uniformly continuous function on totally bounded subset of complete metric space

Solution 1:

As noted in the comments, your approach would not work because totally bounded subsets of complete metric spaces need not be compact.

Instead, if $A$ is a totally bounded subset of a complete metric space $X$, then $\overline{A}$ is totally bounded and complete, hence compact. Thus, $f$ is uniformly continuous on $\overline{A}$, which implies that $f$ is uniformly continuous on $A$.

To see this, note that $f$ being uniformly continuous on $\overline{A}$ means that for all $\epsilon > 0$ there is a $\delta > 0$ such that for $x,y \in \overline{A}$ if $d(x,y) < \delta$ then $d(f(x), f(y)) < \epsilon$. So let $\epsilon > 0$ and get a $\delta > 0$ from uniform continuity on $\overline{A}$. Notice that if $x,y \in A$ with $d(x,y) < \delta$, then $x,y \in \overline{A}$ and also $d(x,y) < \delta$; it follows that for this choice of $\delta$ we have $d(f(x), f(y)) < \epsilon$ (from uniform continuity on $\overline{A}$), which is precisely the uniform continuity of $f$ on $A$.