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

examples-counterexamplesreal-analysisuniform-continuity

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.

Best Answer

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.