# Does a function have to be bounded to be uniformly continuous?

My book defines uniform continuity as a form of continuity that works for any points $a$ and $x$ in an interval $I$ such that

$$|x-a| < \delta$$ implies that $$f(x) - f(a) < \epsilon$$

It then goes on to assert that "If $f$ is continuous over a closed and bounded interval $[a,b]$, it is uniformly continuous on said interval."

My question is this: Does $f$ have to be bounded to be uniformly continuous? If not, can someone give me an example and show me why this is the case? This is a concept that I've only been shown with bounded examples in class (and we don't have class until after Thanksgiving).

I saw there exists a question here like this, but I didn't feel the answer was rigorous enough for me to understand fully.

Let $I$ be an interval of real numbers (bounded or not, closed or not), and $f$ a continuous, real-valued function on $I$.

There are two notions of "boundedness" implicit in your question: boundedness of $I$, and boundedness of $f$. Your book asserts: If $f$ is continuous over a closed and bounded interval $I$, then $f$ is uniformly continuous on $I$. This is true, but note that the term "bounded" here refers to $I$. (It's true, but implicit, that every continuous, real-valued function defined on a closed, bounded interval $[a, b]$ is bounded, by the extreme value theorem.)

In the same vein:

• A uniformly continuous function $f$ on a bounded interval $I$ is bounded whether or not $I$ is closed. (Proving this is a good exercise in using the definition of uniform continuity!) Contrapositively, an unbounded continuous function defined on a bounded interval is not uniformly continuous. (This intuition may have been the origin of your question?)

• As other answers show, a uniformly continuous function on an unbounded interval need not be bounded. The function $f(x) = x$ is certainly an example. A function such as $$f(x) = \begin{cases} x^{2} \sin(1/|x|^{3/2}) & x \neq 0, \\ 0 & x = 0, \end{cases}$$ is in a sense more striking, since the derivative $f'$ is defined everywhere, and is unbounded.

Conversely:

• A continuous, real-valued function $f$ defined on a bounded set $I$ is uniformly continuous on $I$ if and only if $f$ has a continuous extension to the closure of $I$. Particularly, a bounded function on a bounded interval need not be uniformly continuous; for example, take $f(x) = \sin(1/x)$ for $I = (0, 1)$.

• A locally constant function whose domain is not an interval need not be uniformly continuous: $f(x) = x/|x|$ is not uniformly continuous on the set of non-zero real numbers, even though $f$ is constant on some neighborhood of each non-zero real number.

Take $f(x)=x$ on $\mathbb R$.

The easiest counter-example is indeed $f(x)=x$ because it is now obvious that for any $\epsilon>0$, you just have to take $\delta=\epsilon$ to have $|x-y|<\delta\implies|f(x)-f(y)|=|x-y|<\delta=\epsilon$.

Yet, this function is not bounded, obviously.