Let $f$ be a uniformly continuous real function on a bounded subset $E$ of $R$. We have to show f is bounded on $E$.
My proof: Now $diam(E)=diam(cl(E))$, and $cl(E)$ is closed, so $E$ is compact. Since $f$ is uniformly continuous( therefore continuous) $f(cl(E))$ is compact and therefore bounded. Since $E$ is contained in its closure, so is it’s image. So f is bounded on $E$.
Now what I don’t understand is that why do we need the uniform continuity condition? I request anyone to shed some light on this matter.
Note that in your proof idea, $f$ need not be already defined on $\operatorname{cl}(E)$ at all. Something extra beyond continuity is of course needed for $f$ as $f(x) = \frac{1}{x}$ is continuous (not uniformly) on $E= (0,1)$ which is bounded, while $f$ is certainly not bounded on $E$, and not definable on $\operatorname{cl}(E)$.
Suppose that $f[E]$ were unbounded, then we can find points $x_n \in E$ such that $|f(x_n)| > n$ for all $n$. As $\operatorname{cl}(E)$ is closed and bounded, and hence compact, there is some $p \in \operatorname{cl}(E)$ and a subsequence $(x_{n_k})_k \to p$ ($k \to \infty$). The sequence $(x_{n_k})_k$ is Cauchy on $E$ (it's convergent in a larger subspace) and as $f$ is uniformly continuous on $E$ it's easy to check that $(f(x_{n_k})_k$ is Cauchy as well. But $|f(x_{n_k})| > n_k$ makes this impossible. Contradiction , and $f[E]$ is bounded.