Ma · Mathematics

Why Is the Composition of Continuous Functions Continuous?

Published By the 9to5Science editorial team

At a glance

  1. 1. Fix an input

    Choose any point x₀ where you want to prove the composition is continuous.

  2. 2. Use outer continuity

    Continuity of g at f(x₀) gives a tolerance that keeps g’s output within ε.

  3. 3. Use inner continuity

    Continuity of f at x₀ ensures its outputs stay within that tolerance.

  4. 4. Combine the choices

    The resulting neighborhood of x₀ proves g∘f is continuous there.

If you apply one continuous function to the output of another, the result is continuous. The key is that the two continuity conditions apply at different points: the inner function f is continuous at the input x₀, while the outer function g is continuous at f(x₀).

More precisely, if f: ℝ → ℝ and g: ℝ → ℝ are continuous, then their composition

(g∘f)(x)=g(f(x))(g\circ f)(x)=g(f(x))

is continuous. The proof below shows how to choose the required neighborhood of x₀.

The epsilon–delta proof

Fix any x₀ ∈ ℝ. To prove that g∘f is continuous at x₀, take an arbitrary ε > 0. We need to find a δ > 0 such that

∣x−x0∣<δ⟹∣g(f(x))−g(f(x0))∣<ε.|x-x₀|<δ \quad\Longrightarrow\quad |g(f(x))-g(f(x₀))|<ε.

Since g is continuous at f(x₀), there is some η > 0 such that

∣y−f(x0)∣<η⟹∣g(y)−g(f(x0))∣<ε.|y-f(x₀)|<η \quad\Longrightarrow\quad |g(y)-g(f(x₀))|<ε.

Here y is an input to g. We now need f(x) to be within η of f(x₀). Since f is continuous at x₀, there is a δ > 0 such that

∣x−x0∣<δ⟹∣f(x)−f(x0)∣<η.|x-x₀|<δ \quad\Longrightarrow\quad |f(x)-f(x₀)|<η.

Putting the implications together, whenever |x−x₀| < δ, the value f(x) is close enough to f(x₀) for the continuity condition on g to apply. Therefore

∣g(f(x))−g(f(x0))∣<ε.|g(f(x))-g(f(x₀))|<ε.

This proves continuity at x₀. Because x₀ was arbitrary, g∘f is continuous everywhere on ℝ.

A worked example

Let

f(x)=x2,g(t)=t+sin⁡t.f(x)=x^2,\qquad g(t)=t+\sin t.

Both functions are continuous on ℝ, so the composition is continuous. Substituting f(x) into g gives

(g∘f)(x)=x2+sin⁡(x2).(g\circ f)(x)=x^2+\sin(x^2).

You can also verify continuity at a particular point directly. Take x₀ = 1 and let h(x) = x² + sin(x²). Using |sin u − sin v| ≤ |u − v|, we get

∣h(x)−h(1)∣≤∣x2−1∣+∣sin⁡(x2)−sin⁡(1)∣≤2∣x2−1∣=2∣x−1∣∣x+1∣.\begin{aligned} |h(x)-h(1)| &\le |x^2-1|+|\sin(x^2)-\sin(1)|\\ &\le 2|x^2-1|\\ &=2|x-1||x+1|. \end{aligned}

If |x−1| < 1, then |x+1| < 3, so |h(x)−h(1)| < 6|x−1|. Given ε > 0, choose δ = min(1, ε/6). Then |x−1| < δ implies |h(x)−h(1)| < ε, as required.

The general theorem saves you from repeating this kind of estimate for every composition: once you know the component functions are continuous, their composition is continuous too.

The sequential viewpoint

In ℝ, continuity at x₀ is equivalent to the statement that every sequence xₙ converging to x₀ has f(xₙ) converging to f(x₀). This gives a short alternative proof.

If xₙ → x₀, continuity of f gives f(xₙ) → f(x₀). Applying continuity of g to that convergent sequence gives g(f(xₙ)) → g(f(x₀)). Thus the composition carries every sequence converging to x₀ to a sequence converging to g(f(x₀)), which proves that g∘f is continuous at x₀.

Common mistakes

  • Using continuity of g at the wrong point. The relevant point for the outer function is f(x₀), not generally x₀.
  • Choosing the tolerances in the wrong order. First choose η using continuity of g and the desired ε. Then use continuity of f to find δ that makes |f(x)−f(x₀)| < η.
  • Assuming uniform continuity is needed. The proof only uses ordinary continuity at particular points. Neither f nor g needs to be uniformly continuous.
  • Confusing the order of composition. In g∘f, you apply f first and then g. The same theorem applies to f∘g if both functions are continuous, but that is a different function.
  • Ignoring where the functions are defined. For more general domains, the output of the inner function must lie in the domain of the outer function. The result is continuous wherever that composition is defined and the component functions are continuous at the relevant points.

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.