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.
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\).
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.
Choose any \(\varepsilon>0\). We want \(|g(f(x))-g(f(a))|<\varepsilon\).
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\).
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\).
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:
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:
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\).
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
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.
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.
- Identify the inner function \(f\), the outer function \(g\), and the point \(a\).
- Compute \(f(a)\); this is the point where the outer function must be continuous.
- Check that \(f(a)\) lies in the domain of \(g\), and that the composition is defined in the domain under consideration.
- Verify continuity of \(f\) at \(a\) and of \(g\) at \(f(a)\).
- 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.
- If \(f\) is continuous at \(a\) and \(g\) is continuous at \(f(a)\), what does the composition theorem conclude?
- 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\)?
- Why must the range of the inner function be compatible with the domain of the outer function?
- In the epsilon-delta proof, which continuity condition supplies the tolerance for the input of \(g\)?
- Does failure of continuity of \(g\) at \(f(a)\) prove that \(g\circ f\) is discontinuous at \(a\)? Explain briefly.