Tutorials › Calculus I › Continuity of Compositions: The Chain of Input and Output

Continuity and the Intermediate Value Theorem · Tutorial 276 of 1495

Continuity of Compositions: The Chain of Input and Output

Track an input through nested functions and determine exactly which continuity checks establish continuity of the resulting composition.

Beginner 10 min read

What You'll Learn

  • Define the composition of two functions and identify its domain.
  • State the pointwise continuity test for a composition.
  • Follow the epsilon-delta steps that prove the composition theorem.
  • Check the outer function at the inner function’s output, not at the original input.
  • Apply continuity tests to quotients and a nested piecewise example.
  • Distinguish a sufficient continuity test from a necessary one.

Following an Input Through Two Functions

A composition applies one function and then feeds its output into another. If \(f\) acts first and \(g\) acts second, the output is written \(g(f(x))\), or \((g\circ f)(x)\). The order matters: the input to \(g\) is the value produced by \(f\), not the original \(x\).

Continuity of a composition depends on continuity at two linked points. First, the inner function must be continuous at the starting input. Then the outer function must be continuous at the value the inner function produces there. Checking the wrong point for the outer function is a common source of errors.

Definition: Suppose \(f:A\to B\) and \(g:B\to C\), where \(A,B,C\) are subsets of \(\mathbb{R}\). The composition \(g\circ f:A\to C\) is defined by \((g\circ f)(x)=g(f(x))\). The condition \(f(A)\subseteq B\) ensures that every output of \(f\) is an allowed input to \(g\).

The Continuity Test for a Composition

Continuity at a point is understood relative to the function’s domain. A function \(f:A\to\mathbb{R}\) is continuous at \(a\in A\) if, for every \(\varepsilon>0\), there is a \(\delta>0\) such that whenever \(x\in A\) and \(|x-a|<\delta\), we have \(|f(x)-f(a)|<\varepsilon\). This definition requires the function to be defined at \(a\).

Theorem: Let \(f:A\to B\) and \(g:B\to C\). If \(f\) is continuous at \(a\in A\) and \(g\) is continuous at \(f(a)\in B\), then \(g\circ f\) is continuous at \(a\). In particular, the outer function must be continuous at the inner function’s output \(f(a)\).

The condition has a simple input-output interpretation. An input \(x\) close to \(a\) produces an inner output \(f(x)\) close to \(f(a)\). Continuity of \(g\) then ensures that outputs of \(g\) at those nearby inner values are close to \(g(f(a))\).

Why the Theorem Works

The proof joins the two continuity guarantees. Start with a desired tolerance for the final output of \(g\). Continuity of \(g\) tells us how close its input must be to \(f(a)\). Continuity of \(f\) then tells us how close \(x\) must be to \(a\) to make \(f(x)\) meet that requirement.

1
Set a target for the final output.
Choose any \(\varepsilon>0\). We want \(|g(f(x))-g(f(a))|<\varepsilon\).
2
Use continuity of the outer function.
Since \(g\) is continuous at \(f(a)\), there is an \(\eta>0\) such that for \(y\in B\), \(|y-f(a)|<\eta\) implies \(|g(y)-g(f(a))|<\varepsilon\).
3
Use continuity of the inner function.
Since \(f\) is continuous at \(a\), there is a \(\delta>0\) such that for \(x\in A\), \(|x-a|<\delta\) implies \(|f(x)-f(a)|<\eta\).
4
Apply the outer-function guarantee.
For such an \(x\), take \(y=f(x)\), which belongs to \(B\). Then \(|y-f(a)|=|f(x)-f(a)|<\eta\), so \(|g(f(x))-g(f(a))|<\varepsilon\). This is the definition of continuity of \(g\circ f\) at \(a\).

The proof is complete: the \(\delta\) chosen for the input controls the inner output closely enough to use the outer function’s \(\eta\)-condition. No separate limit calculation is needed.

Worked Examples

Worked Example: A Quadratic Followed by a Linear Function

Let \(f(x)=x^2+1\) and \(g(u)=2u-3\). Show that \(g\circ f\) is continuous at \(x=2\), and find its value there.

First evaluate the inner function at the input:

$$ f(2)=2^2+1=5. $$

The outer function must therefore be checked at \(u=5\), and \(g(5)=2(5)-3=7\). Both functions are continuous at the required points. For instance, \(f\) is continuous at \(2\) because \(|f(x)-f(2)|=|x^2-4|=|x-2||x+2|\). If \(|x-2|<1\), then \(1<x<3\), so \(|x+2|<5\); taking \(|x-2|<\min(1,\varepsilon/5)\) makes \(|f(x)-f(2)|<\varepsilon\). The linear function \(g\) is continuous since \(|g(u)-g(5)|=2|u-5|\).

By the theorem, \(g\circ f\) is continuous at \(2\). Its formula and value are:

$$ (g\circ f)(x)=2(x^2+1)-3=2x^2-1, \qquad (g\circ f)(2)=2(4)-1=7. $$

As a check, evaluating in the original order gives \(g(f(2))=g(5)=7\), which agrees with the simplified formula.

Worked Example: A Quotient with a Domain Check

Let \(f(x)=x^2\) and \(g(u)=\frac{1}{u+1}\). Show that \(g\circ f\) is continuous at \(x=1\).

The inner function is continuous at \(1\), since it is a product of continuous functions, and \(f(1)=1^2=1\). The outer function is continuous at \(u=1\): it is a quotient of continuous functions there, and its denominator is nonzero because \(1+1=2\ne0\). The composition theorem applies. The domain check also holds: \(f(x)=x^2\ge0\), so \(f(x)+1\ge1\ne0\) for every real \(x\). Thus the composition is defined for every real \(x\).

$$ (g\circ f)(x)=\frac{1}{x^2+1}, \qquad (g\circ f)(1)=\frac{1}{1^2+1}=\frac12. $$

Checking by the original order gives \(f(1)=1\), followed by \(g(1)=1/(1+1)=1/2\). This confirms the value from the composed formula. The quotient rule for continuity is applicable here precisely because the denominator does not vanish.

Worked Example: A Nested Composition at a Piecewise Boundary

Consider \(f(x)=x^2+1\), \(g(u)=2u-1\), and \(h(v)=v\) for \(v\le1\), while \(h(v)=2v-1\) for \(v>1\). Show that \(h\circ g\circ f\) is continuous at \(x=0\).

The inner stages give \(f(0)=1\) and \(g(f(0))=g(1)=1\). The final function \(h\) must be continuous at \(v=1\). Its value there is \(h(1)=1\), and both expressions meet there: the left expression gives \(1\), while the right expression approaches \(2(1)-1=1\).

For a direct continuity check, if \(|v-1|<1\), then \(0<v<2\). On the left side, \(|h(v)-h(1)|=|v-1|\). On the right side, \(|h(v)-h(1)|=|2v-2|=2|v-1|\). Therefore either case gives \(|h(v)-h(1)|\le2|v-1|\). Given \(\varepsilon>0\), choosing \(|v-1|<\min(1,\varepsilon/2)\) proves continuity at \(1\). The functions \(f\) and \(g\) are continuous at \(0\) and \(1\), respectively, so applying the composition theorem through the chain proves continuity of \(h\circ g\circ f\) at \(0\).

The formula also provides a check. Since \(g(f(x))=2x^2+1\), this value equals \(1\) at \(x=0\) and is greater than \(1\) when \(x\ne0\). Thus

$$ (h\circ g\circ f)(x)= \begin{cases} 1, & x=0,\\ 2(2x^2+1)-1=4x^2+1, & x\ne0. \end{cases} $$

At \(x=0\), the displayed formula gives \(1\), which agrees with the chain \(f(0)=1\), \(g(1)=1\), and \(h(1)=1\). For \(x\ne0\), the expression \(4x^2+1\) approaches \(1\) as \(x\) approaches \(0\), consistent with the continuity test.

Track the Correct Point and the Correct Domain

For \(g(f(x))\), the point at which to test continuity of \(g\) is \(f(a)\), not \(a\). Also check that the composition is defined: the inner output must belong to the domain of the outer function. A continuity argument cannot repair an undefined function value.

Common pitfall: Let \(f(x)=x+1\), \(g(u)=u^2\), and \(a=2\). A wrong calculation checks \(g\) at \(2\) and reports \(g(2)=4\) as the composition’s value. But the inner output is \(f(2)=3\), so the correct calculation is $$ (g\circ f)(2)=g(f(2))=g(3)=3^2=9. $$ The outer function’s relevant input is \(3\), and both functions are continuous at the required points.

The theorem gives a sufficient condition, not a claim that every composition with a discontinuous outer function must be discontinuous. For example, define \(g(u)=0\) when \(u\ge0\) and \(g(u)=1\) when \(u<0\), and let \(f(x)=x^2\). The function \(g\) is discontinuous at \(f(0)=0\), but \(f(x)\ge0\) for every \(x\), so \(g(f(x))=0\) for every \(x\). The composition is constant and hence continuous. The theorem guarantees continuity when both checks pass; it does not rule out continuity by other means when one check fails.

A Reliable Procedure

When applying the composition theorem, write down the input and output points before deciding whether the test applies.

  1. Identify the inner function \(f\), the outer function \(g\), and the point \(a\).
  2. Compute \(f(a)\); this is the point where the outer function must be continuous.
  3. Check that \(f(a)\) lies in the domain of \(g\), and that the composition is defined in the domain under consideration.
  4. Verify continuity of \(f\) at \(a\) and of \(g\) at \(f(a)\).
  5. Conclude that \(g\circ f\) is continuous at \(a\), then check the composed value against \(g(f(a))\).

This method is useful whenever a function is built in stages. It keeps the roles of the functions and their input points distinct, while allowing continuity to pass from one stage to the next.

Check Your Understanding

For each question, identify the relevant input and output points before applying a continuity test.

  1. If \(f\) is continuous at \(a\) and \(g\) is continuous at \(f(a)\), what does the composition theorem conclude?
  2. For \(f(x)=x^2+2\) and \(g(u)=1/u\), at which point must continuity of \(g\) be checked to test \(g\circ f\) at \(x=1\)?
  3. Why must the range of the inner function be compatible with the domain of the outer function?
  4. In the epsilon-delta proof, which continuity condition supplies the tolerance for the input of \(g\)?
  5. Does failure of continuity of \(g\) at \(f(a)\) prove that \(g\circ f\) is discontinuous at \(a\)? Explain briefly.

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon