Continuity on Intervals and Sets

What does it mean for a function to be "continuous on [0,1][0,1]"? The limit definition of continuity requires points on both sides to make sense. At an endpoint like x=0x=0, there is no room to approach from the left. So the ordinary two-sided limit lim⁡x→0f(x)\lim_{x\to 0} f(x) may not even be a sensible demand. Yet we routinely say f(x)=xf(x)=\sqrt{x} is continuous on [0,1][0,1], endpoints included. Making this precise requires upgrading "continuity at a point" to "continuity relative to a set." It also requires handling endpoints through One-Sided Limits. This matters because almost every major theorem of one-variable analysis depends on it. This includes the Intermediate Value Theorem, the Extreme Value Theorem, integrability of continuous functions, and Uniform Continuity. Each is a statement about a function continuous on an interval, not merely continuous at isolated points. Getting the definition of "continuous on a set" right, especially at boundary points, is the hinge on which all of these results turn. A sloppy definition either excludes functions that obviously ought to count (like x\sqrt{x} on [0,1][0,1]). Or it silently smuggles in false theorems. The big picture is that continuity is fundamentally a local, relative notion. It depends on which points are "nearby" cc within the set on which we're working. On an open interval, every point has room on both sides. So relative continuity reduces to ordinary two-sided continuity. On a closed interval [a,b][a,b], the endpoints only have neighbors on one side within the set. So continuity there is defined using one-sided limits. This same idea generalizes uniformly to any subset E⊆RE \subseteq \mathbb{R}. It does so via a single unifying ε\varepsilon–δ\delta definition relative to EE. This article gives the precise definition of continuity on a general set. It shows this definition specializes correctly to the open-interval and closed-interval cases. It proves the key structural theorem: continuity on a set is equivalent to continuity at each point of the set relative to that set. It also proves an algebraic closure theorem (sums, products, quotients, compositions). Along the way we build the necessary machinery. This includes endpoint behavior, worked examples with a jump discontinuity removed only relative to a subset, and a counterexample showing why the "relative" qualifier cannot be dropped. These tools are needed to state the three landmark theorems that follow.

Key takeaways
  • Continuity "at a point" only needs two-sided limits when that point has neighbors on both sides; at endpoints of [a,b][a,b] we must fall back on one-sided limits.
  • The general definition: ff is continuous on EE at c∈Ec\in E if for every ε>0\varepsilon>0 there is δ>0\delta>0 such that x∈Ex\in E and ∣x−c∣<δ|x-c|<\delta force ∣f(x)−f(c)∣<ε|f(x)-f(c)|<\varepsilon — everything is relativized to EE.
  • On an open set/interval this reduces to ordinary continuity at each point; on [a,b][a,b] it reduces to continuity on (a,b)(a,b) plus right-continuity at aa and left-continuity at bb.
  • Continuity on a set is a pointwise, local condition checked one point at a time, not a single global δ\delta — that stronger global version is Uniform Continuity.
  • Sums, products, quotients (where defined), and compositions of continuous functions on a set are continuous on that set — proved directly from the ε\varepsilon–δ\delta relative definition.
  • Key idea: continuity on a set is continuity at every point of that set using only points of the set itself to test nearness, with one-sided limits automatically supplying the right notion at boundary points.

Where this lives today

Continuity on a set is the precise hypothesis behind essentially every existence theorem in single-variable analysis. The Intermediate Value Theorem requires exactly "ff continuous on [a,b][a,b]" in the relative sense proven here — the endpoint values f(a),f(b)f(a), f(b) must genuinely be the right one-sided limits, or the theorem's proof (via the least-upper-bound of the set of points where ff stays negative) breaks down. The Extreme Value Theorem similarly requires continuity on a closed, bounded interval; the closedness is used precisely so that endpoint continuity, as defined here via one-sided limits, is part of the hypothesis, ruling out functions like f(x)=1/xf(x)=1/x on (0,1](0,1] which blow up as the excluded endpoint is approached. Uniform Continuity takes this article's local, point-by-point definition and strengthens it to a single global δ\delta, a distinction essential to proving that continuous functions on compact sets are Riemann integrable. In numerical analysis, root-finding algorithms such as bisection depend on continuity on a closed interval including verified endpoint behavior. In probability theory, cumulative distribution functions are typically only right-continuous, a one-sided continuity notion structurally identical to the endpoint definition given here. In complex analysis and topology, the relatively-open-set characterization proven above generalizes verbatim to continuous maps between arbitrary topological spaces, making it the bridge between elementary ε\varepsilon–δ\delta analysis and general topology.

:::quiz[Which is the correct condition for f:[a,b]→Rf:[a,b]\to\mathbb{R} to be continuous at the endpoint aa?]

  • lim⁡x→af(x)=f(a)\lim_{x\to a} f(x) = f(a), two-sided
  • lim⁡x→a+f(x)=f(a)\lim_{x\to a^+} f(x) = f(a) ✓
  • lim⁡x→a−f(x)=f(a)\lim_{x\to a^-} f(x) = f(a)
  • ff must be differentiable at aa

:::quiz[Let E={0}∪[1,2]E=\{0\}\cup[1,2] and f(0)=100f(0)=100, f(x)=xf(x)=x on [1,2][1,2]. Is ff continuous on EE?]

  • No, because f(0)=100f(0)=100 is far from nearby values
  • No, because EE is not an interval
  • Yes, because 00 is an isolated point of EE so continuity there is automatic ✓
  • Yes, but only because 100100 happens to be an integer

:::quiz[Why does the counterexample E=[0,1]∪[2,3]E=[0,1]\cup[2,3] with f=0f=0 on [0,1][0,1], f=1f=1 on [2,3][2,3] NOT contradict the Intermediate Value Theorem?]

  • It does contradict it; the theorem is simply false in this generality
  • The IVT requires EE to be a single interval, and [0,1]∪[2,3][0,1]\cup[2,3] is not an interval ✓
  • The IVT only applies to polynomials
  • ff is not actually continuous on EE in this example

:::faq[Why can't we just use the ordinary two-sided limit definition at every point of [a,b][a,b], including the endpoints?] Because at x=ax=a, there are no points of the domain [a,b][a,b] to the left of aa, so the two-sided limit lim⁡x→af(x)\lim_{x\to a} f(x) is not defined at all — it would require values of ff at points less than aa, which simply don't exist. The ε\varepsilon–δ\delta definition, honestly interpreted, only ever quantifies over xx actually in the domain, so at aa the "x∈Ex\in E" restriction silently forces x>ax > a (aside from x=ax=a itself), which is precisely the definition of the right-hand limit. This is not an ad hoc patch; it's what the general relative definition produces automatically once you take the "x∈Ex\in E" clause seriously, as proved in the Corollary above.

:::faq[If ff is continuous on (a,b)(a,b), does that automatically make it continuous on [a,b][a,b] once we define f(a)f(a) and f(b)f(b) suitably?] Only if the one-sided limits actually exist and you set the endpoint values equal to them. Continuity on (a,b)(a,b) says nothing by itself about whether lim⁡x→a+f(x)\lim_{x\to a^+}f(x) exists; for example f(x)=sin⁡(1/x)f(x)=\sin(1/x) is continuous on (0,1)(0,1) but has no limit as x→0+x\to 0^+, so no choice of f(0)f(0) makes the extension continuous on [0,1)[0,1). When the one-sided limits do exist, defining f(a):=lim⁡x→a+f(x)f(a):=\lim_{x\to a^+}f(x) and f(b):=lim⁡x→b−f(x)f(b):=\lim_{x\to b^-}f(x) is exactly what's needed, by the Corollary proven above, to make the extended function continuous on the closed interval.

Ask the tutor: Why does the Extreme Value Theorem fail if the closed interval is replaced by an open one, even though the function is continuous on the whole open interval?

DefinitionContinuity at a point relative to a set

Let E⊆RE \subseteq \mathbb{R}, let f:E→Rf : E \to \mathbb{R}, and let c∈Ec \in E. We say ff is continuous at cc relative to EE (or just continuous at cc when EE is understood) if for every ε>0\varepsilon > 0 there exists δ>0\delta > 0 such that

x∈E and ∣x−c∣<δ⟹∣f(x)−f(c)∣<ε.x \in E \text{ and } |x - c| < \delta \quad \Longrightarrow \quad |f(x) - f(c)| < \varepsilon.

We say ff is continuous on EE if ff is continuous at cc relative to EE for every c∈Ec \in E. Two important special cases recover familiar language:

  • If cc is a limit point of EE (i.e. every neighborhood of cc contains points of EE other than cc), the definition above is equivalent to
lim⁡x→c, x∈Ef(x)=f(c),\lim_{x \to c,\ x \in E} f(x) = f(c),

interpreting the limit relative to EE. When E=(a,b)E = (a,b) and c=ac = a, this limit is exactly the right-hand limit lim⁡x→a+f(x)\lim_{x\to a^+} f(x); when c=bc = b it is the left-hand limit lim⁡x→b−f(x)\lim_{x \to b^-} f(x).

  • If cc is an isolated point of EE (some neighborhood of cc meets EE only at cc), then ff is automatically continuous at cc relative to EE, since for small enough δ\delta the only x∈Ex \in E with ∣x−c∣<δ|x-c|<\delta is x=cx = c itself, and ∣f(c)−f(c)∣=0<ε|f(c)-f(c)|=0<\varepsilon trivially.

For an open interval E=(a,b)E = (a,b), every c∈Ec \in E has a full two-sided neighborhood inside EE, so continuity on (a,b)(a,b) coincides with ordinary continuity at each point in the sense of Continuity at a Point. For a closed interval E=[a,b]E = [a,b] with a<ba<b: ff is continuous on [a,b][a,b] if and only if ff is continuous at every c∈(a,b)c \in (a,b) in the ordinary two-sided sense, ff is right-continuous at aa (meaning lim⁡x→a+f(x)=f(a)\lim_{x\to a^+} f(x) = f(a)), and ff is left-continuous at bb (meaning lim⁡x→b−f(x)=f(b)\lim_{x\to b^-} f(x) = f(b)).

Intuition

Think of continuity at cc as a promise: make xx close enough to cc, and I will make f(x)f(x) close to f(c)f(c). The subtlety is the phrase "close enough" — close enough among which candidate xx's? If ff is only defined on EE, it is meaningless to demand the promise hold for xx outside EE; there is no f(x)f(x) to control. So the promise is always tested using x∈Ex \in E only. This is not a weakening of continuity for the sake of convenience — it is the only logically coherent way to state the definition when the domain is not all of R\mathbb{R}. At an interior point of an interval, EE surrounds cc symmetrically, so "close enough within EE" is indistinguishable from "close enough in R\mathbb{R}": the relative and absolute notions agree. At an endpoint like aa in E=[a,b]E=[a,b], the set EE only extends to the right of aa; there is no left side to test, so the ε\varepsilon–δ\delta condition automatically becomes a statement purely about the right-hand behavior — recovering exactly the one-sided limit condition lim⁡x→a+f(x)=f(a)\lim_{x\to a^+}f(x)=f(a). A second, easily overlooked feature: continuity on a set is a pointwise property checked separately at each point, possibly with a different δ\delta at each cc and each ε\varepsilon. This is what makes it different from — and weaker than — the single, uniform δ\delta demanded by Uniform Continuity, a distinction the next figure is designed to make vivid alongside the endpoint picture.

:::svg[Endpoint continuity of f(x)=xf(x)=\sqrt{x} on [0,4][0,4] tested at c=0c=0 using only points of E=[0,4]E=[0,4]] x y f(x) = √x c = 0 only test x ≥ 0 (no left side exists) δ |f(x) - 0| < ε

TheoremLocal characterization of continuity on a set

Let E⊆RE \subseteq \mathbb{R} and f:E→Rf : E \to \mathbb{R}. Then ff is continuous on EE if and only if for every open set V⊆RV \subseteq \mathbb{R}, the set

f−1(V)={x∈E:f(x)∈V}f^{-1}(V) = \{ x \in E : f(x) \in V \}

is relatively open in EE, meaning f−1(V)=U∩Ef^{-1}(V) = U \cap E for some open set U⊆RU \subseteq \mathbb{R}.

Proof

We prove both directions using the ε\varepsilon–δ\delta definition directly; this is the standard topological reformulation of continuity, adapted to a relative domain, and it will be the tool we use repeatedly.

(⇒\Rightarrow) Suppose ff is continuous on EE. Let V⊆RV \subseteq \mathbb{R} be open, and let G=f−1(V)={x∈E:f(x)∈V}G = f^{-1}(V) = \{x \in E : f(x) \in V\}. We must produce an open U⊆RU \subseteq \mathbb{R} with G=U∩EG = U \cap E. If G=∅G = \varnothing, take U=∅U = \varnothing, which is open, and ∅=∅∩E\varnothing = \varnothing \cap E. So assume G≠∅G \neq \varnothing and fix c∈Gc \in G. Then f(c)∈Vf(c) \in V, and since VV is open there is εc>0\varepsilon_c > 0 with (f(c)−εc,f(c)+εc)⊆V(f(c)-\varepsilon_c, f(c)+\varepsilon_c) \subseteq V. By continuity of ff at cc relative to EE (applied with this εc\varepsilon_c), there exists δc>0\delta_c > 0 such that

x∈E, ∣x−c∣<δc  ⟹  ∣f(x)−f(c)∣<εc  ⟹  f(x)∈V.x \in E,\ |x-c| < \delta_c \implies |f(x)-f(c)| < \varepsilon_c \implies f(x) \in V.

Equivalently, E∩(c−δc,c+δc)⊆GE \cap (c-\delta_c, c+\delta_c) \subseteq G. Define

U=⋃c∈G(c−δc, c+δc).U = \bigcup_{c \in G} (c - \delta_c,\ c + \delta_c).

As a union of open intervals, UU is open. We claim G=U∩EG = U \cap E.

  • (G⊆U∩EG \subseteq U\cap E): Each c∈Gc \in G lies in EE and in its own interval (c−δc,c+δc)⊆U(c-\delta_c,c+\delta_c) \subseteq U, so c∈U∩Ec \in U \cap E.
  • (U∩E⊆GU \cap E \subseteq G): If x∈U∩Ex \in U \cap E, then x∈(c−δc,c+δc)x \in (c-\delta_c, c+\delta_c) for some c∈Gc \in G, and x∈Ex \in E; by the containment shown above, x∈E∩(c−δc,c+δc)⊆Gx \in E \cap (c-\delta_c,c+\delta_c) \subseteq G.

Hence G=U∩EG = U \cap E, so GG is relatively open in EE.

(⇐\Leftarrow) Suppose f−1(V)f^{-1}(V) is relatively open in EE for every open V⊆RV \subseteq \mathbb{R}. Fix c∈Ec \in E and ε>0\varepsilon > 0. Let V=(f(c)−ε,f(c)+ε)V = (f(c)-\varepsilon, f(c)+\varepsilon), an open set containing f(c)f(c). By hypothesis, f−1(V)=U∩Ef^{-1}(V) = U \cap E for some open U⊆RU \subseteq \mathbb{R}. Since f(c)∈Vf(c) \in V, we have c∈f−1(V)=U∩Ec \in f^{-1}(V) = U \cap E, so c∈Uc \in U. Because UU is open, there is δ>0\delta > 0 with (c−δ,c+δ)⊆U(c-\delta, c+\delta) \subseteq U. Now suppose x∈Ex \in E and ∣x−c∣<δ|x - c| < \delta. Then x∈(c−δ,c+δ)⊆Ux \in (c-\delta,c+\delta) \subseteq U and x∈Ex \in E, so x∈U∩E=f−1(V)x \in U \cap E = f^{-1}(V), meaning f(x)∈Vf(x) \in V, i.e. ∣f(x)−f(c)∣<ε|f(x) - f(c)| < \varepsilon. This is exactly the continuity condition at cc relative to EE, for the given ε\varepsilon. Since ε>0\varepsilon>0 and c∈Ec \in E were arbitrary, ff is continuous on EE. ■\blacksquare

∎

:::corollary[Reduction to endpoints on [a,b][a,b]] Let f:[a,b]→Rf : [a,b] \to \mathbb{R} with a<ba < b. Then ff is continuous on [a,b][a,b] if and only if: (i) ff is continuous at every c∈(a,b)c \in (a,b) in the ordinary two-sided sense; (ii) lim⁡x→a+f(x)=f(a)\displaystyle\lim_{x \to a^+} f(x) = f(a); and (iii) lim⁡x→b−f(x)=f(b)\displaystyle\lim_{x \to b^-} f(x) = f(b).

Proof

This is immediate from the Definition of continuity at a point relative to a set applied at each type of point of [a,b][a,b], and does not require the topological reformulation above (that theorem is not used here — this is a direct unwinding of the ε\varepsilon–δ\delta definition, avoiding circularity).

Interior points. Let c∈(a,b)c \in (a,b). Choose r=min⁡(c−a,b−c)>0r = \min(c-a, b-c) > 0, so that (c−r,c+r)⊆[a,b](c-r,c+r) \subseteq [a,b]. For δ<r\delta < r, the condition "x∈[a,b]x \in [a,b] and ∣x−c∣<δ|x-c|<\delta" is equivalent to "x∈Rx \in \mathbb{R} and ∣x−c∣<δ|x-c|<\delta," since every such xx automatically lies in (c−r,c+r)⊆[a,b](c-r,c+r) \subseteq [a,b]. Hence, for such δ\delta, continuity of ff at cc relative to [a,b][a,b] is verbatim the ordinary two-sided continuity condition at cc. (Any valid δ\delta from the ordinary definition can be shrunk below rr without breaking the implication, since shrinking δ\delta only removes candidate xx's; so the two conditions are logically equivalent.) This proves the equivalence of continuity on [a,b][a,b] at cc with ordinary continuity at cc, for each interior cc.

Left endpoint aa. Here aa is a limit point of [a,b][a,b], and every x∈[a,b]x \in [a,b] with x≠ax \ne a satisfies x>ax > a. So the condition "x∈[a,b]x \in [a,b], 0<∣x−a∣<δ0<|x-a|<\delta" is equivalent to "a<x<a+δa < x < a+\delta" (for δ≤b−a\delta \le b-a). Thus the relative-continuity condition at aa,

∀ε>0 ∃δ>0: x∈[a,b], ∣x−a∣<δ  ⟹  ∣f(x)−f(a)∣<ε,\forall \varepsilon>0\ \exists \delta>0:\ x\in[a,b],\,|x-a|<\delta \implies |f(x)-f(a)|<\varepsilon,

is precisely the statement lim⁡x→a+f(x)=f(a)\lim_{x\to a^+} f(x) = f(a) (the case x=ax=a contributes ∣f(a)−f(a)∣=0<ε|f(a)-f(a)|=0<\varepsilon trivially and imposes no extra condition). This proves the equivalence at aa.

Right endpoint bb. Symmetrically, every x∈[a,b]x \in [a,b] with x≠bx \neq b satisfies x<bx < b, so the relative-continuity condition at bb is exactly lim⁡x→b−f(x)=f(b)\lim_{x\to b^-} f(x) = f(b). Since continuity on [a,b][a,b] means continuity at every point of [a,b][a,b] relative to [a,b][a,b], and we have shown this is equivalent, point by point, to (i), (ii), (iii) respectively, the corollary follows. ■\blacksquare

∎
TheoremAlgebra of continuous functions on a set

Let E⊆RE \subseteq \mathbb{R}, let f,g:E→Rf, g : E \to \mathbb{R} be continuous on EE, and let α∈R\alpha \in \mathbb{R}. Then: 1. f+gf + g and αf\alpha f are continuous on EE. 2. fgfg is continuous on EE. 3. If g(x)≠0g(x) \neq 0 for all x∈Ex \in E, then f/gf/g is continuous on EE. 4. (Composition) If h:f(E)→Rh : f(E) \to \mathbb{R} is continuous on f(E)f(E), then h∘fh \circ f is continuous on EE.

Proof

Fix c∈Ec \in E and ε>0\varepsilon > 0 throughout; we produce a valid δ>0\delta>0 for the relative continuity condition at cc in each case. This is a direct ε\varepsilon–δ\delta argument, the same technique used to prove the algebra of limits, transplanted to the relative setting — no circularity, since it uses only the definition, not any theorem we are trying to prove.

(1) Sum and scalar multiple. Since f,gf,g are continuous at cc relative to EE, choose δ1>0\delta_1>0 so that x∈E, ∣x−c∣<δ1⇒∣f(x)−f(c)∣<ε/2x\in E,\ |x-c|<\delta_1 \Rightarrow |f(x)-f(c)|<\varepsilon/2, and δ2>0\delta_2>0 so that x∈E, ∣x−c∣<δ2⇒∣g(x)−g(c)∣<ε/2x\in E,\ |x-c|<\delta_2\Rightarrow |g(x)-g(c)|<\varepsilon/2. Let δ=min⁡(δ1,δ2)>0\delta=\min(\delta_1,\delta_2)>0. If x∈Ex \in E and ∣x−c∣<δ|x-c|<\delta, the triangle inequality gives

∣(f+g)(x)−(f+g)(c)∣=∣(f(x)−f(c))+(g(x)−g(c))∣≤∣f(x)−f(c)∣+∣g(x)−g(c)∣<ε2+ε2=ε.|(f+g)(x)-(f+g)(c)| = |(f(x)-f(c)) + (g(x)-g(c))| \le |f(x)-f(c)|+|g(x)-g(c)| < \tfrac\varepsilon2+\tfrac\varepsilon2=\varepsilon.

So f+gf+g is continuous at cc relative to EE; since cc was arbitrary, f+gf+g is continuous on EE. For αf\alpha f: if α=0\alpha = 0 the function is constant, trivially continuous. If α≠0\alpha \ne 0, given ε>0\varepsilon>0 choose δ>0\delta>0 with x∈E,∣x−c∣<δ⇒∣f(x)−f(c)∣<ε/∣α∣x\in E, |x-c|<\delta \Rightarrow |f(x)-f(c)|<\varepsilon/|\alpha|; then ∣αf(x)−αf(c)∣=∣α∣∣f(x)−f(c)∣<ε|\alpha f(x)-\alpha f(c)| = |\alpha||f(x)-f(c)| <\varepsilon.

(2) Product. First note continuity of ff at cc (relative to EE) implies ff is bounded near cc in EE: taking ε=1\varepsilon=1 in the definition gives δ0>0\delta_0>0 with x∈E,∣x−c∣<δ0⇒∣f(x)−f(c)∣<1x\in E,|x-c|<\delta_0 \Rightarrow |f(x)-f(c)|<1, hence ∣f(x)∣≤∣f(c)∣+1=:M|f(x)| \le |f(c)|+1 =: M for such xx. Let ε>0\varepsilon>0. Write

f(x)g(x)−f(c)g(c)=f(x)(g(x)−g(c))+g(c)(f(x)−f(c)).f(x)g(x)-f(c)g(c) = f(x)\big(g(x)-g(c)\big) + g(c)\big(f(x)-f(c)\big).

Choose δ1≤δ0\delta_1 \le \delta_0 so that x∈E,∣x−c∣<δ1⇒∣g(x)−g(c)∣<ε2Mx \in E, |x-c|<\delta_1 \Rightarrow |g(x)-g(c)| < \dfrac{\varepsilon}{2M} (possible since M>0M>0; if M=0M=0 then f≡f(c)=0f\equiv f(c)=0 near cc in EE and the first term vanishes identically, so this case is handled trivially by choosing δ1=δ0\delta_1=\delta_0). Choose δ2>0\delta_2>0 so that x∈E,∣x−c∣<δ2⇒∣f(x)−f(c)∣<ε2(∣g(c)∣+1)x\in E, |x-c|<\delta_2 \Rightarrow |f(x)-f(c)| < \dfrac{\varepsilon}{2(|g(c)|+1)}. Let δ=min⁡(δ0,δ1,δ2)\delta=\min(\delta_0,\delta_1,\delta_2). Then for x∈Ex \in E, ∣x−c∣<δ|x-c|<\delta:

∣f(x)g(x)−f(c)g(c)∣≤∣f(x)∣ ∣g(x)−g(c)∣+∣g(c)∣ ∣f(x)−f(c)∣<M⋅ε2M+∣g(c)∣⋅ε2(∣g(c)∣+1)<ε2+ε2=ε.|f(x)g(x)-f(c)g(c)| \le |f(x)|\,|g(x)-g(c)| + |g(c)|\,|f(x)-f(c)| < M\cdot\frac{\varepsilon}{2M} + |g(c)|\cdot \frac{\varepsilon}{2(|g(c)|+1)} < \frac{\varepsilon}{2}+\frac{\varepsilon}{2}=\varepsilon.

(3) Quotient. By (2) it suffices to show 1/g1/g is continuous on EE whenever gg is continuous on EE and never zero on EE (then f/g=f⋅(1/g)f/g = f \cdot (1/g)). Fix c∈Ec\in E; let ε>0\varepsilon>0. Since g(c)≠0g(c)\ne 0, let η=∣g(c)∣/2>0\eta = |g(c)|/2 >0. By continuity of gg at cc, choose δ1>0\delta_1>0 with x∈E,∣x−c∣<δ1⇒∣g(x)−g(c)∣<ηx\in E, |x-c|<\delta_1 \Rightarrow |g(x)-g(c)|<\eta, which forces ∣g(x)∣≥∣g(c)∣−η=∣g(c)∣/2>0|g(x)| \ge |g(c)|-\eta = |g(c)|/2 >0 by the reverse triangle inequality. Choose δ2>0\delta_2>0 with x∈E,∣x−c∣<δ2⇒∣g(x)−g(c)∣<ε g(c)22x\in E,|x-c|<\delta_2 \Rightarrow |g(x)-g(c)| < \dfrac{\varepsilon\, g(c)^2}{2}. Let δ=min⁡(δ1,δ2)\delta=\min(\delta_1,\delta_2). For x∈Ex\in E, ∣x−c∣<δ|x-c|<\delta:

∣1g(x)−1g(c)∣=∣g(x)−g(c)∣∣g(x)∣∣g(c)∣<εg(c)2/2(∣g(c)∣/2) ∣g(c)∣=ε.\left|\frac{1}{g(x)}-\frac{1}{g(c)}\right| = \frac{|g(x)-g(c)|}{|g(x)||g(c)|} < \frac{\varepsilon g(c)^2/2}{(|g(c)|/2)\,|g(c)|} = \varepsilon.

(4) Composition. Let ε>0\varepsilon>0. Since hh is continuous at f(c)∈f(E)f(c) \in f(E) relative to f(E)f(E), there is η>0\eta>0 such that

y∈f(E), ∣y−f(c)∣<η  ⟹  ∣h(y)−h(f(c))∣<ε.y \in f(E),\ |y-f(c)|<\eta \implies |h(y)-h(f(c))|<\varepsilon.

Since ff is continuous at cc relative to EE, there is δ>0\delta>0 such that

x∈E, ∣x−c∣<δ  ⟹  ∣f(x)−f(c)∣<η.x\in E,\ |x-c|<\delta \implies |f(x)-f(c)|<\eta.

Combining: if x∈Ex \in E and ∣x−c∣<δ|x-c|<\delta, then f(x)∈f(E)f(x) \in f(E) and ∣f(x)−f(c)∣<η|f(x)-f(c)|<\eta, so applying the first implication with y=f(x)y=f(x) gives ∣h(f(x))−h(f(c))∣<ε|h(f(x))-h(f(c))|<\varepsilon. Thus h∘fh\circ f is continuous at cc relative to EE. Since c∈Ec\in E was arbitrary, h∘fh\circ f is continuous on EE. ■\blacksquare

∎

Worked examples

Example 1 — a genuinely one-sided endpoint check. Let

f(x)={sin⁡(x−1)x−1,1<x≤3,1,x=1.f(x) = \begin{cases} \dfrac{\sin(x-1)}{x-1}, & 1 < x \le 3, \\[4pt] 1, & x = 1. \end{cases}

Show ff is continuous on [1,3][1,3], using the endpoint corollary. Interior points (1,3)(1,3). For c∈(1,3)c \in (1,3), f(x)=sin⁡(x−1)/(x−1)f(x) = \sin(x-1)/(x-1) is a quotient of continuous functions (sine composed with the continuous map x↦x−1x \mapsto x-1, divided by x−1x-1) on the set (1,3)(1,3) where the denominator x−1≠0x - 1 \ne 0. By the algebra-of-continuity theorem (parts 2, 3, 4, applied on the open set (1,3)(1,3) where ordinary and relative continuity coincide), ff is continuous at every such cc. Left endpoint c=1c=1. We must check lim⁡x→1+f(x)=f(1)=1\lim_{x\to 1^+} f(x) = f(1) = 1. Substituting u=x−1→0+u = x-1 \to 0^+,

lim⁡x→1+sin⁡(x−1)x−1=lim⁡u→0+sin⁡uu=1,\lim_{x\to 1^+} \frac{\sin(x-1)}{x-1} = \lim_{u\to 0^+} \frac{\sin u}{u} = 1,

using the standard one-sided (and in fact two-sided) limit lim⁡u→0sin⁡uu=1\lim_{u\to 0}\frac{\sin u}{u}=1. This matches f(1)=1f(1)=1, so ff is right-continuous at 11. Right endpoint c=3c=3. Since 3∈(1,3]3 \in (1,3] is not an endpoint requiring a separate one-sided argument beyond ordinary continuity — wait: 33 is the right endpoint of [1,3][1,3], but ff is already given by the same closed-form expression at x=3x=3 (no case split there), and that expression is continuous at 33 as a quotient of continuous functions with nonzero denominator 3−1=2≠03-1=2\ne 0; two-sided continuity at an endpoint always implies the required one-sided continuity, since the one-sided limit is a special case of the two-sided one. Concretely lim⁡x→3−f(x)=f(3)=sin⁡(2)/2\lim_{x\to 3^-} f(x) = f(3) = \sin(2)/2 by continuity of the formula itself. Hence by the Corollary, ff is continuous on [1,3][1,3].

Example 2 — continuity on a set that is neither open nor closed, and a genuinely removable behavior only at one non-endpoint. Let E=[0,1)∪{2}E = [0,1) \cup \{2\}, and define f:E→Rf: E \to \mathbb{R} by

f(x)={x2,x∈[0,1),5,x=2.f(x) = \begin{cases} x^2, & x \in [0,1), \\ 5, & x = 2. \end{cases}

Show ff is continuous on EE. Points in [0,1)[0,1). Fix c∈[0,1)c \in [0,1). Choose r=min⁡(c,1−c)r = \min(c, 1-c) if c>0c > 0; if c=0c=0, we treat it as a one-sided endpoint of EE on the left, since no points of EE lie left of 00. In either case, for x∈Ex \in E near cc (within a small enough radius), xx lies in [0,1)[0,1), not at the isolated point 22 — because 22 is at distance ≥1\ge 1 from any c∈[0,1)c\in[0,1), we may always choose δ≤1−c\delta \le 1 - c (or, at c=0c=0, δ≤1\delta\le 1) to exclude x=2x=2 from consideration entirely. On [0,1)[0,1), f(x)=x2f(x) = x^2 is a product of the continuous identity function with itself (Theorem, part 2), hence continuous at each c∈[0,1)c \in [0,1) relative to [0,1)[0,1); at c=0c=0 this uses the one-sided (right) limit lim⁡x→0+x2=0=f(0)\lim_{x\to 0^+} x^2 = 0 = f(0), matching the endpoint case of the definition since 00 is the left edge of [0,1)⊂E[0,1)\subset E. Explicitly at c=0c=0: given ε>0\varepsilon>0, take δ=min⁡(1,ε)\delta = \min(1,\sqrt\varepsilon). If x∈Ex\in E and ∣x−0∣<δ|x-0|<\delta, then since δ≤1\delta \le 1, x≠2x \ne 2 (as ∣2−0∣=2>δ|2-0|=2 > \delta), forcing x∈[0,1)x \in [0,1), and ∣f(x)−f(0)∣=x2<δ2≤ε|f(x)-f(0)| = x^2 < \delta^2 \le \varepsilon. The isolated point c=2c=2. Since {2}\{2\} is isolated in EE (indeed (1.5,2.5)∩E={2}(1.5,2.5)\cap E = \{2\}), continuity there is automatic: given any ε>0\varepsilon>0, take δ=0.5\delta = 0.5; then x∈E,∣x−2∣<0.5x\in E, |x-2|<0.5 forces x=2x=2, so ∣f(x)−f(2)∣=0<ε|f(x)-f(2)|=0<\varepsilon. Hence ff is continuous on all of E=[0,1)∪{2}E = [0,1)\cup\{2\} — despite the enormous, discontinuous-looking jump from values near 11 (approaching 11) to the isolated value 55 at x=2x=2. This illustrates that continuity on EE only ever compares ff at points that are actually close within EE; since no point of [0,1)[0,1) is close to 22 inside EE, no contradiction arises. If we had instead defined E′=[0,2]E' = [0,2] with the same formulas, ff would fail to be continuous at c=1c=1-adjacent points approaching from the right of 11 within E′E' — but 1∉E1 \notin E in our actual example, so this concern does not arise here.

CounterexampleDropping "relative to EE" and testing with points outside the domain breaks everything

The hypothesis that nearness is tested only using points of EE is not a technical nicety — omitting it destroys the theory. Consider

E=[0,1]∪[2,3],f(x)={0,x∈[0,1]1,x∈[2,3].E = [0,1] \cup [2,3], \qquad f(x) = \begin{cases} 0, & x \in [0,1] \\ 1, & x \in [2,3]. \end{cases}

Using the correct, relative definition: ff is continuous on EE. Indeed, for c∈[0,1]c \in [0,1], choose δ=0.5\delta = 0.5; then x∈Ex \in E with ∣x−c∣<δ|x-c|<\delta forces x∈[0,1]x \in [0,1] (since the gap to [2,3][2,3] is at least 11 once c≤1c\le 1 and δ=0.5\delta=0.5), so f(x)=0=f(c)f(x)=0=f(c) exactly, giving ∣f(x)−f(c)∣=0<ε|f(x)-f(c)|=0<\varepsilon for any ε>0\varepsilon>0. Symmetrically for c∈[2,3]c \in [2,3]. So every point of EE passes the relative continuity test, at every ε\varepsilon, with an honest δ\delta. Now suppose instead we (incorrectly) required the ε\varepsilon–δ\delta condition to hold for all real xx with ∣x−c∣<δ|x-c|<\delta, i.e. we drop the restriction "x∈Ex \in E" and instead implicitly extend ff by treating undefined values as violations, or equivalently ask whether ff, viewed as a function on all of R\mathbb{R} (undefined on (1,2)(1,2)), satisfies the ordinary two-sided continuity definition at c=1c=1. There, no δ>0\delta>0 works: f(1)=0f(1) = 0, but ff is not even defined for x∈(1,1+δ)x \in (1, 1+\delta) when δ<1\delta < 1, so the ordinary definition cannot be satisfied (there is no value f(x)f(x) to compare to f(1)f(1)), and one is forced either to declare ff discontinuous at 11, or to make an ill-posed comparison to undefined quantities. This shows: if you drop the "for x∈Ex \in E" restriction (i.e. you insist on testing the promise against points that may not even lie in the domain), the very statement "ff is continuous at cc" becomes either meaningless (comparing to undefined values) or forces you to falsely reject perfectly good functions like this one, whose restriction to each piece is manifestly as continuous as a constant function can be. The relative qualifier is what makes "ff continuous on [0,1]∪[2,3][0,1]\cup[2,3]" a coherent, checkable, and true statement.

Scope, edge cases & common traps

SituationCorrect treatment
cc interior to EE (full 2-sided neighborhood in EE)Ordinary two-sided continuity at cc
cc = left endpoint of an interval component of EERight-hand limit must equal f(c)f(c)
cc = right endpoint of an interval component of EELeft-hand limit must equal f(c)f(c)
cc isolated point of EEAutomatically continuous at cc — no limit condition to check
EE not an interval (e.g. two disjoint intervals)Check continuity on each piece; no comparison needed between pieces
Function continuous on EE but EE not closedExtreme Value Theorem and Uniform Continuity guarantees can fail (see below)

The mathematician behind it

Origins · 1 minKarl Weierstrass and how this was discovered
KW
Karl Weierstrass
1815–1897 · German analysis, University of Berlin

Weierstrass is the figure most responsible for the rigorous ε\varepsilon–δ\delta formulation of limits and continuity used throughout this article. Trained originally in law and later working for years as a secondary-school teacher in remote Prussian towns, he developed his analytic rigor largely in isolation before his 1854 paper on Abelian functions brought him to prominence and, soon after, a professorship in Berlin. There he built the arithmetization of analysis: defining real numbers, limits, and continuity purely in terms of inequalities among numbers, banishing appeals to geometric intuition or infinitesimals as primitive undefined objects. His lectures — never published by him directly, but transcribed and circulated by students such as Cantor and Schwarz — fixed the modern definition of continuity at a point and, by extension, continuity on a set, exactly the local, relativized ε\varepsilon–δ\delta formulation given here.

History
- 1817 — Bolzano gives an early, largely unnoticed rigorous proof of the Intermediate Value Theorem using a precursor ε\varepsilon–δ\delta-style continuity notion.
- 1821 — Cauchy's Cours d'analyse defines continuity via infinitesimal increments, an important but not yet fully arithmetized precursor.
- 1854–1860s — Weierstrass, in Berlin lectures, formulates continuity at a point with quantified ε,δ\varepsilon,\delta inequalities, the ancestor of the definition used here.
- 1872 — Weierstrass constructs a function continuous everywhere but differentiable nowhere, sharpening the distinction between continuity and smoothness.
- 1890s — Textbook treatments (following Jordan, and later reorganized by Rudin and others in the 20th century) formalize continuity on a set, unifying open-interval and closed-interval (endpoint) cases via one-sided limits, exactly as presented here.
Is continuity on a set the same as being continuous "as a function on all of R\mathbb{R}"?

No, and this distinction matters. A function ff defined only on EE has no meaning outside EE, so "continuous on all of R\mathbb{R}" doesn't even parse unless you first extend ff to all reals. Continuity on EE is entirely intrinsic to EE: it only compares values of ff at points that are close to each other within EE. The counterexample with E=[0,1]∪[2,3]E=[0,1]\cup[2,3] shows a function that is perfectly continuous on EE yet has no continuous extension to [0,3][0,3] agreeing with both pieces, because the Intermediate Value Theorem would force a contradiction on any such extension.

Why does the theorem require checking BOTH left- and right-continuity separately at interior points, rather than combining them into one condition?

At an interior point c∈(a,b)c\in(a,b), both one-sided limits exist as sub-cases of the full two-sided limit, and requiring the two-sided limit to equal f(c)f(c) is logically equivalent to requiring both one-sided limits to exist, be equal to each other, and equal f(c)f(c). We don't need to check them "separately" at interior points — the proof of the Corollary shows the two-sided ε\varepsilon–δ\delta condition is recovered exactly, because a full neighborhood of cc lies in [a,b][a,b]. The one-sided treatment is only forced upon us at the endpoints a,ba,b, where a full two-sided neighborhood does not fit inside the domain.

Does continuity on a set imply the function is bounded, or attains a maximum, on that set?

Not in general — both can fail if the set is not closed and bounded. For instance f(x)=1/xf(x)=1/x is continuous on (0,1](0,1] but unbounded as x→0+x\to 0^+, since 00 is excluded from the domain so there is no endpoint-continuity requirement forcing boundedness there. The Extreme Value Theorem recovers boundedness and attainment of extrema, but only under the extra hypothesis that the domain is a closed, bounded interval (or more generally a compact set) — continuity alone, on an arbitrary set, is not enough.

How does this relative definition generalize beyond R\mathbb{R}?

The ε\varepsilon–δ\delta formulation given here, and especially the equivalent open-set/relatively-open-set characterization proved in the theorem above, transplants verbatim to any metric space, and even to general topological spaces (replacing ε\varepsilon-balls with open sets and "relatively open in EE" with the subspace topology). This is exactly why the topological reformulation was included: it is the version of continuity-on-a-set that survives unchanged when you leave R\mathbb{R} for higher dimensions or abstract spaces, whereas the raw one-sided-limit language is special to the order structure of R\mathbb{R}.

Is an isolated point of the domain really always a point of continuity, with no exceptions?

Yes, and this sometimes feels counterintuitive until you check the definition directly. If cc is isolated in EE, there is some radius r>0r>0 such that the only point of EE within distance rr of cc is cc itself. Given any ε>0\varepsilon>0, choosing δ=r\delta=r makes the hypothesis "x∈Ex\in E, ∣x−c∣<δ|x-c|<\delta" force x=cx=c, so the conclusion ∣f(x)−f(c)∣=0<ε|f(x)-f(c)|=0<\varepsilon holds trivially, regardless of how ff behaves elsewhere. There is genuinely no way for this to fail — it is a direct, unconditional consequence of the ε\varepsilon–δ\delta definition, not a convention imposed by fiat.

Before this

Where this leads