Why Boundaries Need a Separate Check
A piecewise formula may use simple, continuous expressions on every region and still define a discontinuous function. The issue is at the points where the formula changes, or where a value is assigned separately: nearby inputs can approach from either side, and the two formulas and the assigned value must be compatible. The useful test is local. First check continuity inside each region; then, at each boundary, compare the two one-sided limits with the function value there.
Throughout, the real line \(\mathbb{R}\) has its standard metric, with distance \(|x-y|\). A function \(f:\mathbb{R}\to\mathbb{R}\) is continuous at \(c\) if, for every \(\varepsilon>0\), there is a \(\delta>0\) such that \(|x-c|<\delta\) implies \(|f(x)-f(c)|<\varepsilon\). It is continuous on a region if it is continuous at every point of that region.
Thus a limit from one side describes the behavior of the formula on that side, while continuity also requires agreement with the value assigned at the boundary. In the test below, one-sided limits are finite real numbers. If a required one-sided limit does not exist as a finite real number, continuity at that boundary is impossible.
The Boundary Continuity Test
- each formula \(\phi_j\) defines a continuous function on its open interval; and
- at every boundary \(c_i\), the left-hand limit and right-hand limit exist and both equal \(f(c_i)\).
Proof. First suppose \(f\) is continuous on \(\mathbb{R}\). Its restriction to any open interval on which one formula applies is continuous: for a point in that interval, choose a sufficiently small \(\delta\) so that all inputs within \(\delta\) remain in the interval, and then use continuity of \(f\) at the point. At a boundary \(c_i\), continuity says that for every \(\varepsilon>0\), some \(\delta>0\) gives \(|f(x)-f(c_i)|<\varepsilon\) whenever \(|x-c_i|<\delta\). This implication applies both when \(c_i-\delta<x<c_i\) and when \(c_i<x<c_i+\delta\). By the definitions of one-sided limits, both limits exist and equal \(f(c_i)\).
Conversely, suppose each formula is continuous on its open interval and the two one-sided limits at every boundary equal the assigned value. Every point that is not a boundary has a neighborhood contained in one open interval. On that neighborhood \(f\) is given by a continuous formula, so \(f\) is continuous at the point. Now fix a boundary \(c_i\) and \(\varepsilon>0\). The left-hand limit condition gives a \(\delta_L>0\) such that \(c_i-\delta_L<x<c_i\) implies \(|f(x)-f(c_i)|<\varepsilon\). The right-hand limit condition gives a \(\delta_R>0\) such that \(c_i<x<c_i+\delta_R\) implies the same inequality. Set \(\delta=\min(\delta_L,\delta_R)\). If \(|x-c_i|<\delta\), then either \(x=c_i\), when \(|f(x)-f(c_i)|=0<\varepsilon\), or \(x\) lies on one of the two sides, where the appropriate limit condition applies. Hence \(f\) is continuous at \(c_i\). This holds at every boundary and every nonboundary point, so \(f\) is continuous on \(\mathbb{R}\). \(\square\)
The theorem separates the work into two tasks. Continuity inside a region is checked using the formula there; the boundary test does not replace that check. At a boundary, the two side limits must agree with each other and with the assigned value. Matching the side limits alone is not enough.
Worked Example: Two Polynomial Pieces That Join Continuously
Define \(f:\mathbb{R}\to\mathbb{R}\) by
Each formula is continuous on its region because polynomial functions are continuous. The only boundary is \(x=1\). From the left, the formula gives \(\lim_{x\to1^-}x^2=1^2=1\). From the right, \(\lim_{x\to1^+}(2x-1)=2(1)-1=1\). Since \(1\ge1\), the assigned value is \(f(1)=2(1)-1=1\). The boundary test therefore gives continuity at \(1\), and \(f\) is continuous everywhere.
Direct check at the join: let \(\varepsilon>0\) and take \(\delta=\min(1,\varepsilon/3)\). If \(1-\delta<x<1\), then \(0<x<2\), so \(|x+1|<3\). Therefore \(|f(x)-f(1)|=|x^2-1|=|x-1||x+1|<3\delta\le\varepsilon\). If \(1\le x<1+\delta\), then \(|f(x)-f(1)|=|2x-1-1|=2|x-1|<2\delta\le 2\varepsilon/3<\varepsilon\). The case \(x=1\) gives difference \(0\). This verifies the epsilon-delta condition at the boundary.
Check: the boundary value is computed from the branch that includes \(x=1\), namely \(2(1)-1=1\); it agrees with each one-sided limit, both computed as \(1\).
Worked Example: Matching Side Limits but a Wrong Assigned Value
Define \(g:\mathbb{R}\to\mathbb{R}\) by
The two formulas are continuous on their respective open regions. At \(0\), the left-hand limit is \(\lim_{x\to0^-}(x+2)=0+2=2\), and the right-hand limit is \(\lim_{x\to0^+}(2-x)=2-0=2\). The side limits match each other, but \(g(0)=5\), not \(2\). The boundary test shows that \(g\) is not continuous at \(0\).
Direct check: take \(\varepsilon=1\). For any \(\delta>0\), let \(x=\min(\delta/2,1/2)\). Then \(0<x\le1/2\) and \(x<\delta\), so the right-hand formula applies and \(|g(x)-g(0)|=|(2-x)-5|=3+x\ge3>1\). Thus no \(\delta\) can meet the continuity condition for this \(\varepsilon\).
Check: substituting \(x=0\) into the middle case gives \(g(0)=5\). Substituting \(0\) into the expressions for the side limits gives \(2\) from the left and \(2\) from the right. The discrepancy is exactly between the limiting value \(2\) and the assigned value \(5\).
Worked Example: Repairing a Removable Discontinuity
Define \(h:\mathbb{R}\to\mathbb{R}\) by
For \(x\ne2\), factor the numerator: \(x^2-4=(x-2)(x+2)\). Since the denominator is nonzero on this region, cancellation gives \(h(x)=x+2\) for every \(x\ne2\). This formula is continuous on each side of \(2\). The left-hand limit is \(2+2=4\), and the right-hand limit is also \(2+2=4\). The assigned value is \(h(2)=4\), so the boundary test shows that \(h\) is continuous at \(2\), and hence on all of \(\mathbb{R}\).
Direct check: for every \(x\ne2\), \(|h(x)-h(2)|=|(x+2)-4|=|x-2|\). Given \(\varepsilon>0\), choose \(\delta=\varepsilon\). If \(|x-2|<\delta\), then for \(x\ne2\) the displayed equality gives \(|h(x)-h(2)|<\varepsilon\); for \(x=2\), the difference is \(0<\varepsilon\). Thus the epsilon-delta condition holds.
Check: the factorization gives \((x-2)(x+2)\), so the quotient equals \(x+2\) only when \(x\ne2\). At the missing input, the separately assigned value \(4\) agrees with the limit \(2+2=4\).
A Common Pitfall and a Reliable Procedure
Common pitfall: in the second example, one might calculate that both side limits of \(g\) equal \(2\), then incorrectly conclude that \(g\) is continuous at \(0\). That calculation establishes only that the two side limits match. It does not check the value of the function at the boundary. Since \(g(0)=5\), the continuity condition fails. The correction is to compare all three quantities: the left-hand limit, the right-hand limit, and the assigned boundary value.
For a piecewise function with finitely many boundary points, a dependable check is:
- Identify every boundary, including points where a value is assigned separately.
- Check that each formula is continuous at points in its own open region.
- At each boundary \(c\), compute the left-hand limit from the formula used for \(x<c\), and the right-hand limit from the formula used for \(x>c\).
- Compute \(f(c)\) from the case that actually includes \(c\), or from its separate assignment.
- Conclude continuity at \(c\) only if both limits exist and both equal \(f(c)\).
This procedure also distinguishes two common outcomes. If the side limits differ, the function cannot be continuous at the boundary, regardless of the assigned value. If the side limits agree but the assigned value differs, changing the value at that one point to the common limit would make the boundary test pass, provided the formulas remain continuous on their regions.
Check Your Understanding
For each function, check the formula regions first and then apply the boundary test.
- Define \(f(x)=x+1\) for \(x<2\) and \(f(x)=3\) for \(x\ge2\). Is \(f\) continuous at \(2\)? Compute both one-sided limits and \(f(2)\).
- Define \(g(x)=x^2\) for \(x\le0\) and \(g(x)=x\) for \(x>0\). Determine whether \(g\) is continuous at \(0\).
- For \(h(x)=(x^2-9)/(x-3)\) when \(x\ne3\), what value must be assigned at \(3\) to make \(h\) continuous there? Justify your answer using the one-sided limits.
- Can a function be continuous at a boundary if its left-hand limit is \(1\) and its right-hand limit is \(2\), regardless of the value assigned at the boundary? Explain using the boundary test.
- Give an example of a piecewise function whose two one-sided limits agree at a boundary but whose assigned value makes it discontinuous.