# If $f$ differs from a uniformly continuous function by less than $\epsilon$ for any $\epsilon$, then $f$ is uniformly continuous

For any $\epsilon>0$ there exists a function $g$, such that $g$ is uniformly continuous and $|f(x)-g(x)|<\epsilon$. Show that $f$ is uniformly continuous.

I know that I will have to use the definition of a function being uniformly continuous for the function $g$. $|x-x_0| < \delta$ implying $|g(x)-g(x_0)|<\epsilon$.

• Hint: Use triangle inequality. – user139708 May 3 '14 at 20:01
• $|f(x) - f(y)| = |f(x) - g(x) + g(x) - g(y) + g(y) - f(y)| \le |f(x) - g(x)| + |g(x) - g(y)| + |g(y) - f(y)|$... – Tom Bachmann May 3 '14 at 20:04

Under appropriate conditions, you know that $f(x)-g(x)$ is small, $f(y)-g(y)$ is small (just a change of variable) and you know that $g(x)-g(y)$ is small for close $x,y$. Now, try to use the triangle inequality to see that $f(x)-f(y)=f(x)-g(x)+g(x)-g(y)+g(y)-f(y)$ is small.

Let $\epsilon > 0$, then there exists a $\delta > 0$ such that $|f(x) - f(y)| \leq |f(x) - g(x)| + |g(x) - g(y)| + |g(y) - f(y)| \leq 3\epsilon$ whenever $|x-y| < \delta$ by the uniform continuity of $g$.

Expanded hint. First, find $g$ such that $|f(x) - g(x)| < \epsilon / 3$ for all $x$. Then, choose $\delta$ so that $|f(x) - g(y)|$ is sufficiently small. Then use triangle inequality:

$$|f(x) - f(y)| \le |f(x) - g(x)| + |g(x) - g(y)| + |g(y) - f(y)|$$

Uniform continuity: a function $h$ is uniformly continuous if $\forall\varepsilon\gt 0,\,\exists \delta\gt 0 :|h(x)-h(y)|\lt\varepsilon$, whenever $|x-y|\lt\delta$.

Now as we have the original lemma, $\forall\varepsilon\gt 0\,\exists\delta_1\gt 0:|f(x)-g(y)|\lt\frac{\varepsilon}{3}$ whenever $|x-y|\lt\delta_1$.

This also implies $|g(x)-f(y)|\lt\frac{\varepsilon}{3}$ whenever $|x-y|\lt\delta_1$.

since $g$ is uniformly continuous $\forall\varepsilon\gt 0\,\exists\delta_2\gt 0:|g(x)-g(y)|\lt\frac{\varepsilon}{3}$ whenever $|x-y|\lt\delta_2$

Now let $\delta^*=\min\{\delta_1,\delta_2\}$ and we have:

$\forall\varepsilon\gt 0 ,\exists\delta^*\gt 0:|f(x)-f(y)|=|f(x)-g(x)+g(x)-g(y)+g(y)-f(y)|$

$\le|f(x)-g(y)|+|g(x)-f(y)|+|g(x)-g(y)|\lt\frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3}=\varepsilon$, whenever $|x-y|\lt\delta^*$

Thus $f$ is uniformly continuous.