Let $X\subset \mathbb{R^m}$ be a bounded subset. Prove that every uniformly continuous $f: X\rightarrow M$ is bounded. 
Let $X\subset \mathbb{R^m}$ be a bounded subset. Prove that every uniformly continuous function $f: X\rightarrow M$ is bounded. 

The book gives a hint: given a decomposition of $\mathbb{R^m}$ in "cubes" of small edge, express $X$ as a finite union.
That's clearly a generalization of the same proof for the case of $X\subset \mathbb{R}$, where we could express $X$ as a finite union of intervals. Since $f$ was uniformly continuous, then its restriction to every subinterval would also be uniformly continuous, and by a good choice of $\epsilon$ and $\delta$ we could come up with a conclusion that $f(X)$ does have a bounded diameter.
But the problem is that i'm not very used to do analysis in $\mathbb{R^m}$. So it's not so clear how to express this decomposition and even why it is possible. Can someone please turn things more clear?
 A: Do you know each of the following statements?


*

*Each uniformly continuous $f : X \to M$ extends to a (uniformly) continuous $\overline{f} : \overline{X} \to M$, where $\overline{X}$ denotes the closure of $X$.

*If $X \subset \Bbb{R}^m$ is bounded, then $\overline{X}$ is compact.

*Each continuous function on a compact set is bounded.
If so, you should be able to prove your claim.
If not, try to prove each of the claims from above.

Alternatively, you could use that for arbitrary $\delta > 0$, a bounded set $X \subset \Bbb{R}^m$ can be covered by finitely many balls of radius $\delta$, i.e., $X \subset \bigcup_{i=1}^M B_\delta (x_i)$ for certain $x_1,\dots, x_M \in \Bbb{R}^m$ (essentially, this is the same as compactness of $\overline{X}$). Now, since $f$ is uniformly continuous, for $\varepsilon = 1$, there is some $\delta > 0$ such that if $|x-y| < 2\delta$, then $|f(x)-f(y)|<1$. Do you see how you can combine these claims to get what you want?
I think this is what the hint in your book is referring to: If you replace the balls from above by cubes, you can write $\Bbb{R}^m = \bigcup_{k \in \Bbb{Z}^m} (\delta' k + [0,\delta']^m)$, and since $X$ is bounded, only finitely many of these cubes will intersect $X$. This shows that $X$ can be covered by finitely many cubes all of side length $\delta' > 0$. By using that each cube of sidelength $\delta' = \delta / \sqrt{m}$ is contained in a ball of radius $\delta$, you get the claim concerning the balls.
A: I could manage to find an answer. Can someone please tell me if its good?
Attempt:
Given $\epsilon=1$, since $f$ is uniformly continuous, one can find $\delta>0$ such that $|x-y|<\delta$ implies $d(f(x),f(y))<1$, for any $x,y\in X$.
We write a decomposition of $\mathbb{R^m}$ into cubes of edge less than $\delta/\sqrt n$. Since $X$ is bounded, only a finite number of those cubes cover up all $X$, say $X_1,\dots, X_k$.  Given any $x,y\in X$, consider the line $r$ which joins them and let $p$ be the number of points of the intersection of $r$ with the cubes that cover $X$, and write $a_1,\dots, a_p$. We note that $p\leq nk$.  If $p =0$, it is clear that $|x-y|<\delta$, and therefore $d(f(x),f(y))<1$. If $p>0$, then
$d(f(x),f(y))\leq d(f(x),f(a_1))+\dots+d(f(a_p),f(y))\leq 1+\dots+1\leq nk$
which shows that $f(X)$ is a set whose diameter is less than $nk$, by the arbitrary choice of $x,y\in X$. Therefore, $f$ is bounded. 
