Tutorials › Real Analysis › Uniform Continuity Counterexamples

Uniform Continuity · Tutorial 384 of 1000

Uniform Continuity Counterexamples

Learn to build explicit counterexamples to uniform continuity and to recognize when a uniformly continuous perturbation preserves a function’s failure.

Intermediate 10 min read

What You'll Learn

  • Construct sequence pairs that disprove uniform continuity
  • Test reciprocal and logarithmic functions near missing endpoints
  • Detect rapid growth with nearby inputs
  • Use oscillating values to witness failure of uniform continuity
  • Prove that adding a uniformly continuous function preserves uniform continuity status
  • Explain why large local slopes alone do not establish failure

Counterexamples Need Nearby Inputs with Separated Outputs

To disprove uniform continuity, it is not enough to find inputs where a function changes quickly. The definition asks whether one radius works for every pair of inputs in the domain. A counterexample must therefore defeat each proposed radius: however small the input distance is required to be, there must still be a pair of inputs within that distance whose function values remain noticeably separated.

The Sequential Criterion for Uniform Continuity from “Why Uniform Continuity Is Different” packages this idea into a useful test. If there are sequences \(x_n,y_n\in E\) such that \(|x_n-y_n|\to0\), while the output differences do not tend to zero, then \(f\) is not uniformly continuous on \(E\). We will use this established criterion to organize several kinds of counterexamples. The essential work in each example is finding and verifying the right pairs.

Counterexample strategy: To show that \(f:E\to\mathbb{R}\) is not uniformly continuous, look for pairs \(x_n,y_n\in E\) with input distances tending to zero and output distances bounded below by a fixed positive number. Such pairs contradict the Sequential Criterion for Uniform Continuity.

This strategy is especially effective when a function misbehaves near a missing endpoint, grows rapidly on an unbounded domain, or oscillates more and more quickly. In each case the function can still be continuous at every point of its domain. Continuity controls behavior near one fixed point; uniform continuity must control all points at once.

Worked Examples: Boundary Blow-Up and Rapid Growth

Worked Example: The Reciprocal Near a Missing Endpoint

Define \(f:(0,1)\to\mathbb{R}\) by \(f(x)=1/x\). For each integer \(n\geq2\), take

$$ x_n=\frac{1}{n} \qquad\text{and}\qquad y_n=\frac{1}{n+1}. $$

Both points belong to \((0,1)\), and their distance is

$$ |x_n-y_n| =\frac{1}{n}-\frac{1}{n+1} =\frac{1}{n(n+1)} \longrightarrow 0. $$

The corresponding function values are \(f(x_n)=n\) and \(f(y_n)=n+1\), so

$$ |f(x_n)-f(y_n)|=|n-(n+1)|=1. $$

The input distances tend to zero but the output distances stay equal to \(1\). The Sequential Criterion for Uniform Continuity therefore shows that \(f\) is not uniformly continuous on \((0,1)\). The obstruction occurs as the inputs approach the missing endpoint \(0\); there is no single radius that controls the increasingly large changes there.

Worked Example: The Logarithm Near Zero

Consider \(g:(0,1)\to\mathbb{R}\), defined by \(g(x)=\ln x\). For each positive integer \(n\), let

$$ x_n=e^{-n} \qquad\text{and}\qquad y_n=e^{-(n+1)}. $$

Since \(n\geq1\), both inputs lie in \((0,1)\). Their distance satisfies

$$ |x_n-y_n| =e^{-n}-e^{-(n+1)} =e^{-n}(1-e^{-1}) \longrightarrow 0. $$

Using \(\ln(e^t)=t\), the outputs are \(g(x_n)=-n\) and \(g(y_n)=-(n+1)\). Consequently,

$$ |g(x_n)-g(y_n)| =|-n-(-(n+1))| =1. $$

Thus the logarithm is not uniformly continuous on \((0,1)\), despite being continuous at every point of that interval. The example also illustrates why it matters to check the domain: the inputs approach \(0\), which is not in \((0,1)\), so continuity at a point of the domain does not provide a common radius for these pairs.

The first two examples have a common pattern: near a missing endpoint, small changes in input can produce a fixed change in output. A different pattern occurs on an unbounded domain. There the inputs need not approach any finite point; instead, they can move farther and farther out while their separation shrinks.

Worked Example: Cubic Growth on an Unbounded Domain

Let \(h:[0,\infty)\to\mathbb{R}\) be given by \(h(x)=x^3\). Choose

$$ x_n=n \qquad\text{and}\qquad y_n=n+\frac{1}{n}. $$

These inputs belong to the domain, and \(|x_n-y_n|=1/n\to0\). Their output difference can be calculated exactly:

$$ \begin{aligned} |h(y_n)-h(x_n)| &=\left(n+\frac{1}{n}\right)^3-n^3\\ &=3n+\frac{3}{n}+\frac{1}{n^3}\\ &\geq 3n. \end{aligned} $$

The output difference grows without bound while the input distance tends to zero. In particular, it does not tend to zero, so the Sequential Criterion for Uniform Continuity proves that \(h\) is not uniformly continuous on \([0,\infty)\). The inputs are close to one another, but they are located farther and farther along the domain.

A General Result for Integer Powers

The cubic example is part of a broader fact about integer powers. The following theorem gives explicit pairs that work for every integer exponent at least two. It is useful to verify the estimates rather than rely only on an informal claim that the function “grows too quickly.”

Theorem: For every integer \(m\geq2\), the function \(p_m:[0,\infty)\to\mathbb{R}\), defined by \(p_m(x)=x^m\), is not uniformly continuous.

Proof. For each positive integer \(n\), set \(x_n=n\) and \(y_n=n+1/n\). These points lie in \([0,\infty)\), and

$$ |x_n-y_n|=\frac{1}{n}\longrightarrow0. $$

Since \(y_n\geq x_n\geq0\), the binomial theorem gives

$$ \begin{aligned} |p_m(y_n)-p_m(x_n)| &=\left(n+\frac{1}{n}\right)^m-n^m\\ &=\sum_{j=1}^{m}\binom{m}{j}n^{m-j}\left(\frac{1}{n}\right)^j\\ &=\sum_{j=1}^{m}\binom{m}{j}n^{m-2j}. \end{aligned} $$

Every term in the final sum is positive. Its first term is \(m n^{m-2}\), which is at least \(m\) because \(m\geq2\) and \(n\geq1\). Hence

$$ |p_m(y_n)-p_m(x_n)|\geq m\geq2 $$

for every \(n\). The input distances tend to zero, whereas the output distances stay at least \(2\). By the Sequential Criterion for Uniform Continuity, \(p_m\) is not uniformly continuous on \([0,\infty)\). \(\square\)

The conclusion concerns the unbounded domain. It does not say that \(x^m\) fails to be uniformly continuous on every subset of \([0,\infty)\). On bounded intervals, the polynomial estimate from “Uniform Continuity of Polynomials on Bounded Sets” applies. The same function can therefore be uniformly continuous on a bounded interval and fail to be uniformly continuous on the whole half-line.

Worked Example: Increasing Oscillation

Worked Example: Sine of the Square

Define \(q:\mathbb{R}\to\mathbb{R}\) by \(q(x)=\sin(x^2)\). For each positive integer \(n\), choose the positive inputs

$$ x_n=\sqrt{2\pi n+\frac{\pi}{2}} \qquad\text{and}\qquad y_n=\sqrt{2\pi n+\frac{3\pi}{2}}. $$

Their squares are \(2\pi n+\pi/2\) and \(2\pi n+3\pi/2\), respectively. Periodicity of sine therefore gives \(q(x_n)=1\) and \(q(y_n)=-1\). In particular,

$$ |q(x_n)-q(y_n)|=|1-(-1)|=2. $$

Rationalizing the difference between the inputs gives

$$ |y_n-x_n| =\frac{y_n^2-x_n^2}{y_n+x_n} =\frac{\pi}{y_n+x_n} \longrightarrow0, $$

because both \(x_n\) and \(y_n\) tend to infinity. Thus the outputs remain \(2\) apart even though the inputs become arbitrarily close. The Sequential Criterion proves that \(q\) is not uniformly continuous on \(\mathbb{R}\). This is an oscillation example: the function repeatedly moves from \(1\) to \(-1\) over input intervals whose lengths shrink.

The examples show that the mechanism of failure can vary. A function may become unbounded near a missing endpoint, change rapidly at large inputs, or oscillate increasingly fast. The common proof task is always the same: exhibit nearby inputs and calculate their output separation. Merely describing a function as “steep,” “unbounded,” or “oscillatory” does not by itself complete a proof.

Uniformly Continuous Perturbations Preserve the Failure

A useful way to create or recognize counterexamples is to compare a function with another function whose uniform continuity status is known. The key restriction is that the difference between them must itself be uniformly continuous. A bounded difference alone is not enough.

Theorem: Let \(E\subseteq\mathbb{R}\), and let \(f,g:E\to\mathbb{R}\). If \(f-g\) is uniformly continuous on \(E\), then \(f\) is uniformly continuous on \(E\) if and only if \(g\) is uniformly continuous on \(E\).

Proof. Write \(h=f-g\), so \(f=g+h\). Suppose first that \(g\) is uniformly continuous. Given \(\varepsilon>0\), uniform continuity of \(g\) supplies \(\delta_1>0\) such that \(x,y\in E\) and \(|x-y|<\delta_1\) imply \(|g(x)-g(y)|<\varepsilon/2\). Uniform continuity of \(h\) supplies \(\delta_2>0\) such that the same input condition with \(|x-y|<\delta_2\) implies \(|h(x)-h(y)|<\varepsilon/2\). Set \(\delta=\min\{\delta_1,\delta_2\}\). If \(|x-y|<\delta\), then

$$ |f(x)-f(y)| \leq |g(x)-g(y)|+|h(x)-h(y)| <\frac{\varepsilon}{2}+\frac{\varepsilon}{2} =\varepsilon. $$

Therefore \(f\) is uniformly continuous. For the reverse direction, suppose \(f\) is uniformly continuous and use \(g=f-h\). Given \(\varepsilon>0\), choose radii for \(f\) and \(h\) that each make the corresponding output difference less than \(\varepsilon/2\), and take their minimum. The triangle inequality then gives \(|g(x)-g(y)|<\varepsilon\) for every pair within that radius. Thus \(g\) is uniformly continuous, proving both directions. \(\square\)

For example, this theorem explains why adding a uniformly continuous oscillatory term cannot repair a failure of uniform continuity: if the resulting function were uniformly continuous, subtracting the oscillatory term would show that the original function was uniformly continuous as well. The condition on the difference matters. A bounded function need not be uniformly continuous, so knowing only that two functions stay a bounded distance apart does not justify this theorem.

A Common Pitfall: Large Slopes Are Not Enough

The counterexamples above use actual pairs whose input distances shrink while their output differences stay separated. One tempting shortcut is to look for large ratios of output change to input change and conclude that uniform continuity fails. That shortcut is not valid by itself: a large ratio can occur even when the output difference is small.

The square-root function on \([0,\infty)\) illustrates the point. Its difference estimate from “Uniform Continuity of the Square Root” gives

$$ |\sqrt{x}-\sqrt{y}|\leq\sqrt{|x-y|}, $$

so it is uniformly continuous. Nevertheless, for \(x=t^2\) and \(y=0\), where \(t>0\), the ratio of output difference to input difference is

$$ \frac{|\sqrt{x}-\sqrt{y}|}{|x-y|} =\frac{t}{t^2} =\frac{1}{t}, $$

which becomes arbitrarily large as \(t\to0^+\). The output difference itself is \(t\), however, and tends to zero. Thus large ratios alone do not produce the separated outputs required by the sequential test. In a counterexample, always verify both parts: the input distance tends to zero, and the output difference fails to tend to zero.

A final practical check is to ensure every chosen input belongs to the stated domain. Sequences approaching a missing endpoint are useful precisely because the domain allows points arbitrarily close to it; a point outside the domain cannot be used as one of the inputs. Once the domain, input distances, and output differences have all been checked, the sequential criterion turns the calculation into a complete proof.

Check Your Understanding

For each question, focus on the pair construction or hypothesis that makes the argument work.

  1. For the reciprocal on \((0,1)\), what are the input distance and output distance for the chosen pair \(1/n\) and \(1/(n+1)\)?
  2. Why do the inputs in the logarithm example belong to the domain, and what fixed output difference do they produce?
  3. In the theorem for \(x^m\), why is the first term of the binomial sum at least \(m\) when \(m\geq2\) and \(n\geq1\)?
  4. What condition on \(f-g\) allows uniform continuity status to pass between \(f\) and \(g\)?
  5. Why does an arbitrarily large ratio of output change to input change not, by itself, disprove uniform continuity?