A uniformly continuous function maps bounded set to bounded sets

I am trying to prove the following:

If $A\subset\mathbb R$ is bounded and $\,f:A\to \mathbb R\,$ is uniformly continuous, then $f[A]$ is bounded.

Could you check my proof?

Let $A \subseteq [-K,K]\subseteq \mathbb R$. Let $\varepsilon = 1$. If $f$ is uniformly continuous there is $\delta$ wuth $|x-y| <\delta$ imply that $|f(x)-f(y)|<1$ for all $x,y\in A$. Let $a \in A$. Then because $A$ is bounded there is a finite number of balls $B(a_n,\delta)$ that cover $A$. Let the number be $N$. Then $f(a)-N \le f(x) \le f(a) + N$ for all $x\in A$.


Solution 1:

Assume that $f$ is unbounded, and $\sup_{x\in A} f(x)=\infty$. (The case $\inf_{x\in A} f(x)=-\infty$ can be treated in the same way.)

Then, there is a sequence $\{x_n\}\subset A$, such that $f(x_n)\to\infty$. We can pick a subsequence $\{y_n\}$ of $\{x_n\}$, such that $f(y_{n+1})-f(y_n)>1$, for all $n\in\mathbb N$. Since $f$ is uniformly continuous, there exists a $\delta>0$, such that, for all $x,y\in A$, $$ |x-y|<\delta\quad\Longrightarrow\quad |\,f(x)-f(y)|<1.\tag{1} $$ But as $A\subset\mathbb R$ is bounded, then $\{y_n\}$ has a convergent subsequence $z_n\to z\in \overline{A}$. In fact, we may pick the subsequence $\{z_n\}$, so that $|z_m-z_n|<\delta$, for all $m,n\in\mathbb N$, which implies that, for all $m,n\in\mathbb N$, with $m\ne n$, we have $$ |z_m-z_n|<\delta, \quad\text{while}\quad |f(z_m)-f(z_n)|>1, $$ which contradicts $(1)$.

Note. Since $f$ is uniformly continuous, then $f$ extends continuously to $\overline{A}$. This is done in the following way. If $\{x_n\}\subset A$ is Cauchy, then so is $\{f(x_n)\}$, due to the uniform continuity of $f$. Hence, $f(x)$ can be extended continuously (and uniquely) to $\overline{A}$.

But $\overline{A}$ is compact, since $A$ is bounded. The extension of $f$ shall be bounded, as it is continuous on a compact set, and thus $f$ is bounded on $A$.

Solution 2:

My proof is super long but the person that used sequences made me realized there's a much easier proof. Here is the long one anyways because I thought it was interesting:

Let $s=\sup A$ and $t=\inf A$. There is $\delta>0$ such that if $|x-y|<\delta, x,y\in A \Rightarrow |f(x)-f(y)|<1$. Suppose that $f(A)$ is unbounded. Then $s>t\Rightarrow \exists n$ such that $\displaystyle \frac{\delta}{s-t}>\frac{1}{n}\Rightarrow t+n\delta>s$. We will prove that there are $n$ points of $A$ whose union of $\delta-$neighborhoods cover $A$.

Choose $x_{1}\in A\Rightarrow \exists x_{2}\in A$ such that $f(x_{2})>f(x_{1})+1\Rightarrow |x_{2}-x_{1}|\geq \delta$. Similarly, $\exists x_{3}\in A$ such that $f(x_{3})>f(x_{2})+1$ and notice that $|x_{3}-x_{1}|\geq \delta$ and $|x_{3}-x_{2}|\geq \delta$. Suppose that we have chosen $x_{1},\ldots,x_{n}\in A$ and assume, without loss of generality, $x_{1}<x_{2}<\cdots<x_{n}$.

Take $x\in A$ and suppose that $|x_{i}-x|\geq \delta,i=1,\ldots,n$. If $x_{i}-x\geq \delta \Rightarrow x_{n}-x=x_{1}-x+x_{2}-x_{1}+\cdots+x_{n}-x_{n-1}\geq x_{1}-x+\delta(n-1)\geq n\delta \Rightarrow x_{n}>x+n\delta$. But $x+n\delta \geq t+n\delta>s$ and $x_{n}\in A$. Then we have a contradiction. If $x-x_{i}<-\delta\Rightarrow \delta<x_{i}-x\Rightarrow$ repeat the argument. Hence $A\displaystyle \subset \bigcup_{i=1}^{n}(x_{i}-\delta,x_{i}+\delta)$. But $|x_{i}-x|<\delta$ implies $f(x)<f(x_{i})+1$ for some $i\Rightarrow f(x)<\max \left\{f(x_{i})\right\}+1$ contrary to $f(A)$ being unbounded.