# Example of a continuous function $f:\mathbb{R} \to [0,1]$ such that f is not uniformly continuous.

I am trying to find an example of a continuous function $f:\mathbb{R} \to [0,1]$ such that f is not uniformly continuous. I have been playing around with the $sin$ function and I have noticed that $|sin(x^2)|$ is a continuous function from $\mathbb{R}$ to $[0,1]$. This function I am thinking is not uniformly continuous since it behaves a lot like $\sin(x^2)$.

What I am most interested is in how you come up with a function that meets the criteria. For example, when I first saw this question, I immediately thought of the $\sin$ function. Are there any other functions that meet this requirement and are easier to work with in case that I want to prove that it is not uniformly continuous. Is this how you come up with functions, that is, by looking at the rate of oscillations? It seems to me that the only functions that would work are variations of the $sin$ function. I would appreciate it if you could give advice on how to approach this problem.

• you cannot just say "it oscillates a lot" to prove a function is not uniformly continuous, start with the definition
– Nick
Commented Nov 17, 2016 at 6:02
• you are right. Right now I am just constructing graphs that I think are not uniformly continuous and trying to come up with possible functions that meet the requirements. I am just trying to see how people approach the problem rather than proving it. Commented Nov 17, 2016 at 6:05
• You can use the mean value theorem to prove that $\frac 1 2 + \frac 1 2 \sin(x^2)$ isn't uniformly continuous since the derivative becomes arbitrarily large as $x \to \infty$. Commented Nov 17, 2016 at 6:15

The key to finding such a function, is to look for a function with "arbitrarily large derivative" (this doesn't work for all such functions, as the comment below points out) . This is to say, we want some problems with infinity, to be created on the end points.

For example, let us consider $f(x) = \frac{1}{2} + \frac{1}{2}\sin x^2$, which has a derivative of $2x \cos x^2$, and also has range in $[0,1]$ (the $\frac{1}{2}$ is just some adjustment to ensure that the range is in $[0,1]$). This derivative blows up as $x$ increases. Hence, we consider this as a candidate.

Fix a natural number $N$. We will find a pair of points $x,y$ such that $|f(x)-f(y)| \geq N|x-y|$.

Now, all we need is to use the mean value theorem: We know that $f(x)-f(y) = (x-y) f'(z)$ where $z$ is some point between $x$ and $y$. Now, suppose we chose $x$ and $y$ in a region where $f'(z)$ could only be a large positive quantity, greater than the given $N$. Then of course, $|f(x)-f(y)| >N|(x-y)|$.

I leave you to formalize the details, but it is clear, that $f$ cannot be uniformly continuous, despite being differentiable.

• "The key to finding such a function, is to look for a function with "arbitrarily large derivative". " That doesn't always work. Consider $\sin(e^x)/(1+x^2).$ Also the derivative of your function doesn't "blow up" as I understand the term. Rather it oscillates unboundedly.
– zhw.
Commented Nov 17, 2016 at 7:14
• @zhw I see. The point is, my function oscillates unboundedly, as you have said. I mistakenly wrote it as blowing up, but the meaning should be clear. But I understood the example of $\sin (e^x)/ (1+x^2)$, so thank you for pointing it out. It is a function with arbitrarily large derivative, but reducing oscillations, hence could be uniformly continuous. Commented Nov 17, 2016 at 7:25

"Right now I am just constructing graphs that I think are not uniformly continuous and trying to come up with possible functions that meet the requirements. I am just trying to see how people approach the problem rather than proving it."

This is a good strategy, and it's often how I approach analysis problems as well. Having an intuition that a result is "correct" (even if it's due to hand-waving reasoning) is good to have before starting a rigorous proof.

Uniform continuity is sort of like a stronger, "global" version of regular continuity. To wit, if you start with a given $\varepsilon > 0$, then you can find a $\delta > 0$ such that $|x-y| < \delta \implies |f(x) - f(y)| < \varepsilon$, regardless of where you are in the domain. On the other hand, we talk about regular continuity "at a given point", and the $\delta$ depends on that chosen point.

Your idea with $f(x) = |\sin(x^2)|$ is perfect. Indeed, if we suppose that this is uniformly continuous, then we can arrive at a contradiction for essentially the reason you cite: it oscillates faster and faster as we move away from the origin.

To take advantage of this problem, choose $\varepsilon$ less than the amplitude of the wave; e.g. $\varepsilon = 1/2$. If we suppose there exists a $\delta > 0$ such that $|x-y| < \delta$, then $||\sin(x^2)| - |\sin(y^2)|| < 1/2$, we can make this fail by going out far enough away from the origin so that our function goes through an entire oscillation in a $\delta$-interval. Recall that a sine wave reaches a "crest" or a "trough" at every $(2k + 1/2) \pi$ radians and every $(2k + 3/2) \pi$ radians. Solving $x^2 = (2k + 1/2) \pi$ gives the values at which $\sin(x^2)$ reaches a crest, and a similar equation for the troughs. Taking an absolute value results in all of these becoming crests (with new troughs in between each at integer multiples of $\pi$). Now just go out sufficiently far so that the distance between these crests is less than the chosen $\delta$. I'll leave the details to you to crunch out (one can show that the distance between the crests limits to zero).

• Apparently, thge OP added the absolute value to achieve the desired codomain $[0,1]$ Commented Nov 17, 2016 at 6:36
• Oh!! I lost sight of the forest for the trees. Thanks for pointing that out @HagenvonEitzen. Commented Nov 17, 2016 at 6:38
• Thank you Kaj Hansen your explanation is very helpful! Commented Nov 17, 2016 at 7:00
• Glad I could help @AnP. ! Commented Nov 17, 2016 at 7:18