In mathematics, particularly in real analysis and topology, a continuous function is one for which the graph can be sketched without lifting the pencil, intuitively indicating no sudden jumps, breaks, or vertical asymptotes in its behavior.[1] Formally, a function f:D→Rf: D \to \mathbb{R}, where D⊆RD \subseteq \mathbb{R} is the domain, is continuous at a point a∈Da \in D if lim⁡x→af(x)=f(a)\lim_{x \to a} f(x) = f(a), meaning the function value at aa matches the limit of the function values approaching aa.[2] This limit condition is rigorously captured by the epsilon-delta definition, introduced by Karl Weierstrass and Camille Jordan: for every ϵ>0\epsilon > 0, there exists a δ>0\delta > 0 such that if 0<∣x−a∣<δ0 < |x - a| < \delta and x∈Dx \in D, then ∣f(x)−f(a)∣<ϵ|f(x) - f(a)| < \epsilon.[3] A function is continuous on a set if it is continuous at every point in that set, with the entire domain often implying continuity everywhere unless specified otherwise.[4] The modern concept of continuity emerged in the early 19th century, building on earlier intuitive notions of smooth variation dating back to Johannes Kepler's ideas of continuous change in geometry around 1600, but it was Augustin-Louis Cauchy who first formalized it in 1821 as functions taking nearby values at nearby points.[5] Weierstrass further refined this into the epsilon-delta framework in the 1860s, providing the rigorous basis for analysis that resolved ambiguities in earlier calculus practices.[2] By the late 19th century, examples like Karl Weierstrass's 1872 construction of a continuous but nowhere differentiable function challenged assumptions about smoothness, highlighting the depth of the concept.[6] Continuous functions form the foundation of calculus and real analysis, enabling the study of limits, derivatives, and integrals while excluding pathological behaviors that disrupt predictability.[7] They possess key properties, such as being closed under addition, subtraction, multiplication, division (away from zeros), and composition, meaning the result of these operations on continuous functions remains continuous.[8] On compact intervals (closed and bounded sets), continuous functions are bounded and attain their maximum and minimum values, as per the Extreme Value Theorem.[2] Additionally, they satisfy the Intermediate Value Theorem, guaranteeing that the function takes every value between f(a)f(a) and f(b)f(b) for any a<ba < b in the domain.[9] These attributes make continuous functions indispensable in applications ranging from physics modeling smooth motions to engineering optimizations, where abrupt discontinuities could invalidate predictions.[10]

History

Early concepts and intuitive notions

The concept of continuity in early mathematical and philosophical thought emphasized the idea of seamless connection or unbroken extension, particularly in geometric figures and physical motion, without the rigor of later formal definitions. In ancient Greek philosophy, Aristotle provided one of the earliest systematic discussions of continuity, defining it in his Physics as a property of magnitudes where parts are connected such that they share a common boundary, distinguishing continuous entities like lines from discrete ones like numbers. He argued that continua, such as space and time, are infinitely divisible without gaps or indivisibles, rejecting atomistic views that posited discrete particles as the basis of matter. Archimedes, building on these ideas, employed the method of exhaustion to compute areas and volumes bounded by curves, implicitly assuming the curve's continuity as a smooth, gapless boundary that could be approximated by inscribed and circumscribed polygons approaching the true figure.[5] During the medieval period, Islamic scholars advanced intuitive notions of continuity through geometric and optical inquiries. Ibn al-Haytham treated geometrical magnitudes as continuous abstractions from sensible objects, arguing that continuous lines and surfaces exist ideally in the imagination but not as actual infinities in the physical world. His extensive Book of Optics further implied smooth, uninterrupted transitions in the propagation of light rays, modeling vision as a continuous process from emission to perception without abrupt breaks, which influenced later understandings of fluid geometric forms.[11] In the 17th and 18th centuries, European mathematicians like Gottfried Wilhelm Leibniz and Leonhard Euler developed more dynamic intuitive views of continuity, likening functions to flowing quantities. Leibniz articulated the Principle of Continuity, stating that "in any supposed transition ending in any term, it is permissible to make a general inference," which encapsulated his belief in nature's avoidance of leaps (natura non facit saltus), applying this to calculus where quantities change smoothly through infinitesimal steps. His proposed analysis situs, or geometry of position, envisioned continuous motion and deformation of figures without rupture, as in trajectories described as "locus continuus succesivus" (continuous successive locus), laying groundwork for topological ideas. Euler, in his Introductio in analysin infinitorum (1748), informally characterized continuous functions as those "flowing" without interruption, assuming such smoothness when manipulating infinite series expansions, such as representing sine and cosine through power series that converge uniformly without jumps. These notions formalized intuitive geometric continuity into analytic tools, paving the way for later rigorous developments.[5][12]

19th-century formalizations

The formalization of continuity in the 19th century marked a shift from intuitive geometric and algebraic understandings toward rigorous analytic definitions, driven by efforts to resolve paradoxes in calculus and analysis. Bernard Bolzano played a pivotal role in this development with his 1817 publication, Rein analytischer Beweis des Lehrsatzes, daß zwischen je zwey Werthen, die ein entgegengesetztes Resultat gewähren, wenigstens eine reelle Wurzel der Gleichung liefert. In this work, Bolzano defined a function as continuous at a point if, for every difference in function values, there exists a corresponding difference in arguments such that the function values differ by less than any given quantity, effectively linking continuity to the notion of limits. He further connected this definition to the intermediate value property, proving that a continuous function attains every value between any two values it takes, thereby providing an early analytic foundation for the theorem now known as Bolzano's intermediate value theorem.[13] Building on such ideas, Augustin-Louis Cauchy advanced the concept in his 1821 textbook Cours d'analyse de l'École Polytechnique, where he first introduced the term "fonction continue" (continuous function). Cauchy characterized a continuous function as one whose value at any point equals the limit of its values at nearby points, employing the language of "infinitesimally small" quantities to describe how function values approach each other as arguments do. This limit-based approach, detailed in Chapter II of the text, emphasized the preservation of closeness between inputs and outputs, laying groundwork for modern definitions while still retaining some intuitive elements from prior centuries.[14] The push for even greater precision culminated in Karl Weierstrass's contributions during his lectures at the Royal Technical Academy in Berlin, where he presented an epsilon-delta formulation in 1861. Weierstrass defined continuity at a point aa such that for every ϵ>0\epsilon > 0, there exists a δ>0\delta > 0 where if ∣x−a∣<δ|x - a| < \delta, then ∣f(x)−f(a)∣<ϵ|f(x) - f(a)| < \epsilon, stressing arbitrary closeness without reliance on infinitesimals. Similarly, Camille Jordan provided an independent rigorous limit-based definition in his 1882–1883 Cours d'analyse. This arithmetized approach, delivered in his winter semester course and later influencing students like Schwarz, eliminated ambiguities in earlier definitions and became the standard for real analysis.[15][5] A key impetus for these refinements came from Peter Gustav Lejeune Dirichlet's 1837 example of a function discontinuous everywhere, introduced in his lectures on the theory of heat conduction. Defining f(x)=1f(x) = 1 if xx is rational and f(x)=0f(x) = 0 if xx is irrational, Dirichlet demonstrated a function that fails Cauchy's continuity condition at every point due to the density of rationals and irrationals, exposing limitations in prevailing notions and necessitating stricter formalizations like Weierstrass's.[16]

Continuity for real-valued functions

Epsilon-delta definition

The epsilon-delta definition provides a rigorous criterion for the continuity of a real-valued function at a specific point in its domain. Formally, a function f:D→Rf: D \to \mathbb{R}, where D⊆RD \subseteq \mathbb{R}, is continuous at a point a∈Da \in D if for every ϵ>0\epsilon > 0, there exists a δ>0\delta > 0 such that whenever x∈Dx \in D and ∣x−a∣<δ|x - a| < \delta, it follows that ∣f(x)−f(a)∣<ϵ|f(x) - f(a)| < \epsilon.[17] This formulation was first fully articulated by Karl Weierstrass in his 1861 lectures on calculus.[15] The logical structure of the definition emphasizes the universal and existential quantifiers: ∀ϵ>0 ∃δ>0 ∀x∈D(∣x−a∣<δ  ⟹  ∣f(x)−f(a)∣<ϵ)\forall \epsilon > 0 \, \exists \delta > 0 \, \forall x \in D \left( |x - a| < \delta \implies |f(x) - f(a)| < \epsilon \right).[17] The outer universal quantifier over ϵ\epsilon ensures the condition holds for arbitrarily small positive deviations in the output, while the existential quantifier over δ\delta allows the required input tolerance to depend on ϵ\epsilon, and the inner universal quantifier over xx guarantees the implication for all points sufficiently close to aa within the domain. This definition motivates continuity by precisely encoding the idea that arbitrarily small perturbations in the input near aa result in output values arbitrarily close to f(a)f(a), eliminating ambiguities in intuitive descriptions like "no jumps or breaks."[18] For example, consider verifying continuity of the identity function f(x)=xf(x) = x on R\mathbb{R} at any point a∈Ra \in \mathbb{R}. Given ϵ>0\epsilon > 0, select δ=ϵ\delta = \epsilon. Then, for any x∈Rx \in \mathbb{R} with ∣x−a∣<δ|x - a| < \delta, it holds that ∣f(x)−f(a)∣=∣x−a∣<ϵ|f(x) - f(a)| = |x - a| < \epsilon, satisfying the definition.[17] Domain considerations are integral to the definition, as the condition applies only to points xx in DD near aa, and δ\delta must respect the domain's boundaries. A function is said to be continuous on an interval if it is continuous at every point in that interval; for instance, on a closed interval [b,c][b, c], continuity at the endpoints bb and cc requires the implication to hold for xx approaching from within the interval.[17]

Equivalent formulations

A function $ f: D \to \mathbb{R} $, where $ D \subseteq \mathbb{R} $, is continuous at a point $ a \in D $ if it satisfies the epsilon-delta condition, but this can be reformulated in equivalent ways that highlight different aspects of the concept. These equivalences allow for proofs using tools like sequences or neighborhoods, which are often more convenient in specific contexts.[2]

Limit Definition

The limit definition states that $ f $ is continuous at $ a $ if $ \lim_{x \to a} f(x) = f(a) $, assuming $ a $ is an accumulation point of $ D $. This is equivalent to the epsilon-delta definition because the condition for the limit $ \lim_{x \to a} f(x) = L $ is that for every $ \epsilon > 0 $, there exists $ \delta > 0 $ such that if $ 0 < |x - a| < \delta $ and $ x \in D $, then $ |f(x) - L| < \epsilon $. Setting $ L = f(a) $ and noting that the epsilon-delta continuity definition includes the case where $ x = a $ (which holds trivially since $ |f(a) - f(a)| = 0 < \epsilon $), the two coincide. The proof of equivalence follows directly from the definitions: the limit condition implies continuity by the same $ \delta $, and continuity implies the limit by restricting to punctured neighborhoods.[2]

Neighborhood Definition

An alternative topological perspective is the neighborhood definition: $ f $ is continuous at $ a $ if for every neighborhood $ V $ of $ f(a) $, there exists a neighborhood $ U $ of $ a $ such that $ f(U \cap D) \subseteq V $. In the real line with the standard topology, neighborhoods are open intervals, so this reduces to open intervals around $ f(a) $ and $ a $. This is equivalent to epsilon-delta because an $ \epsilon $-neighborhood of $ f(a) $ is $ (f(a) - \epsilon, f(a) + \epsilon) $, and the corresponding $ \delta $-neighborhood of $ a $ ensures $ |f(x) - f(a)| < \epsilon $ for $ x \in D $ with $ |x - a| < \delta $. The proof involves showing that the existence of such $ U $ for every symmetric $ \epsilon $-neighborhood $ V $ matches the epsilon-delta quantifiers, with the converse holding by choosing $ V = (f(a) - \epsilon, f(a) + \epsilon) $ and $ U = (a - \delta, a + \delta) $.[2]

Sequential Definition

The sequential definition characterizes continuity as follows: $ f $ is continuous at $ a $ if for every sequence $ (x_n) $ in $ D $ with $ \lim_{n \to \infty} x_n = a $, it holds that $ \lim_{n \to \infty} f(x_n) = f(a) $. This equivalence relies on the sequential criterion for limits in $ \mathbb{R} $. To prove it, assume continuity via epsilon-delta. Given $ \epsilon > 0 $, choose $ \delta > 0 $ such that $ |x - a| < \delta $ implies $ |f(x) - f(a)| < \epsilon $. For $ (x_n) \to a $, there exists $ N $ such that for $ n > N $, $ |x_n - a| < \delta $, so $ |f(x_n) - f(a)| < \epsilon $, hence $ f(x_n) \to f(a) $. Conversely, suppose the sequential condition holds but continuity fails; then there exists $ \epsilon > 0 $ such that for every $ \delta > 0 $, there is $ x \in D $ with $ |x - a| < \delta $ but $ |f(x) - f(a)| \geq \epsilon $. Construct a sequence $ x_n $ by choosing such $ x $ with $ \delta = 1/n $, so $ x_n \to a $ but $ f(x_n) $ does not approach $ f(a) $, contradicting the assumption. This uses the key lemma that in metric spaces like $ \mathbb{R} $, limits are determined by sequences.[2]

Oscillation Definition

Continuity can also be defined using oscillation: the oscillation of $ f $ at $ a $ is $ \omega_f(a) = \inf_{\delta > 0} \sup { |f(x) - f(y)| : x, y \in D, |x - a| < \delta, |y - a| < \delta } $, and $ f $ is continuous at $ a $ if and only if $ \omega_f(a) = 0 $. This measures the supremum variation of $ f $ in shrinking neighborhoods of $ a $. To prove equivalence to epsilon-delta, first assume continuity. For $ \epsilon > 0 $, there exists $ \delta > 0 $ such that if $ |x - a| < \delta $ and $ x \in D $, then $ |f(x) - f(a)| < \epsilon/2 $. For any $ x, y $ with $ |x - a| < \delta $ and $ |y - a| < \delta $, $ |f(x) - f(y)| \leq |f(x) - f(a)| + |f(y) - f(a)| < \epsilon $, so $ \omega_f(a) \leq \epsilon $. Since $ \epsilon $ is arbitrary, $ \omega_f(a) = 0 $. Conversely, if $ \omega_f(a) = 0 $, for $ \epsilon > 0 $, there exists $ \delta > 0 $ such that $ \sup { |f(x) - f(y)| : |x - a| < \delta, |y - a| < \delta, x,y \in D } < \epsilon $. Then, for $ |x - a| < \delta $ and $ x \in D $, taking $ y = a $, $ |f(x) - f(a)| < \epsilon $, satisfying epsilon-delta. This formulation emphasizes the uniform smallness of differences near $ a $.[19]

Properties of continuous real-valued functions

Algebraic and order properties

Continuous real-valued functions exhibit closure under various algebraic operations. Specifically, if ff and gg are continuous at a point aa in their common domain, then their sum f+gf + g, defined by (f+g)(x)=f(x)+g(x)(f + g)(x) = f(x) + g(x), is continuous at aa. Similarly, the product f⋅gf \cdot g, defined by (f⋅g)(x)=f(x)g(x)(f \cdot g)(x) = f(x) g(x), is continuous at aa. For scalar multiplication, if cc is a real constant, then cfc f, defined by (cf)(x)=cf(x)(c f)(x) = c f(x), is continuous at aa whenever ff is. Moreover, the quotient f/gf / g, defined by (f/g)(x)=f(x)/g(x)(f / g)(x) = f(x) / g(x) where g(x)≠0g(x) \neq 0, is continuous at aa provided g(a)≠0g(a) \neq 0. These properties follow from the preservation of limits under addition, multiplication, and division in the real numbers, combined with the limit definition of continuity./03%3A_Limits_and_Continuity/3.04%3A_Properties_of_Continuous_Functions) Composition of continuous functions also yields a continuous function. If ff is continuous at aa and gg is continuous at f(a)f(a), then the composition g∘fg \circ f, defined by (g∘f)(x)=g(f(x))(g \circ f)(x) = g(f(x)), is continuous at aa. This arises because the limit of f(x)f(x) as xx approaches aa is f(a)f(a), and substituting into gg preserves the limit due to gg's continuity at that point./03%3A_Limits_and_Continuity/3.04%3A_Properties_of_Continuous_Functions) Additional algebraic constructions, such as the absolute value of a continuous function, remain continuous. If ff is continuous at aa, then ∣f∣|f|, defined by ∣f∣(x)=∣f(x)∣|f|(x) = |f(x)|, is continuous at aa. This can be seen by expressing ∣f∣(x)=f(x)2|f|(x) = \sqrt{f(x)^2}, where squaring and the square root function (continuous on [0,∞)[0, \infty)) are both continuous operations./03%3A_Limits_and_Continuity/3.04%3A_Properties_of_Continuous_Functions) Regarding order properties, if ff and gg are continuous functions on a domain and satisfy f(x)≤g(x)f(x) \leq g(x) for all xx in the domain, this pointwise inequality is inherently preserved by the functions themselves, independent of their continuity, though continuity ensures the inequality behaves consistently under limits. More notably, continuous strictly increasing functions preserve order strictly: if ff is continuous and strictly increasing on an interval II, then for all x,y∈Ix, y \in I with x<yx < y, it holds that f(x)<f(y)f(x) < f(y). Furthermore, such functions map connected intervals to connected intervals; specifically, ff maps an interval I⊆RI \subseteq \mathbb{R} onto the interval [inf⁡x∈If(x),sup⁡x∈If(x)][ \inf_{x \in I} f(x), \sup_{x \in I} f(x) ] or an open variant depending on the endpoints. This mapping property stems from the intermediate value theorem applied to the continuous image of connected sets, though the full proof relies on the connectedness of intervals in R\mathbb{R}.[20]

Key theorems

The Intermediate Value Theorem (IVT) asserts that if ff is a continuous function on the closed interval [a,b][a, b] and kk is any real number between f(a)f(a) and f(b)f(b), then there exists some c∈[a,b]c \in [a, b] such that f(c)=kf(c) = k.[13] This theorem, first rigorously proved by Bernard Bolzano in 1817, captures the intuitive notion that continuous functions on intervals cannot "skip" values.[13] A proof of the IVT relies on the bisection method and the completeness of the real numbers. Assume without loss of generality that f(a)<k<f(b)f(a) < k < f(b). Bisect the interval at the midpoint m=(a+b)/2m = (a + b)/2; if f(m)=kf(m) = k, then c=mc = m, otherwise replace either [a,m][a, m] or [m,b][m, b] with the subinterval where kk lies between the endpoint values. Repeating this process generates a sequence of nested closed intervals [an,bn][a_n, b_n] with lengths approaching zero and f(an)<k<f(bn)f(a_n) < k < f(b_n) for all nn. By the nested interval theorem, which follows from the least upper bound property of R\mathbb{R}, the intersection ⋂[an,bn]\bigcap [a_n, b_n] is a single point cc, and continuity ensures f(c)=kf(c) = k.[21] The Extreme Value Theorem (EVT) states that if ff is continuous on the compact interval [a,b][a, b], then ff attains its maximum and minimum values on [a,b][a, b].[22] This result, established by Karl Weierstrass in the 1860s, guarantees the existence of global extrema for continuous functions on closed bounded domains.[22] The Heine-Borel theorem provides the key fact that closed and bounded intervals in R\mathbb{R} are compact: every open cover of [a,b][a, b] has a finite subcover.[23] To prove the EVT, first note that continuity implies ff is bounded on [a,b][a, b] (by the Heine-Borel property and uniform continuity on compact sets), so the supremum M=sup⁡x∈[a,b]f(x)M = \sup_{x \in [a, b]} f(x) is finite.[24] Consider the sequence xnx_n where f(xn)>M−1/nf(x_n) > M - 1/n; by the Bolzano-Weierstrass theorem, it has a convergent subsequence xnk→c∈[a,b]x_{n_k} \to c \in [a, b]. Continuity yields f(c)=lim⁡f(xnk)=Mf(c) = \lim f(x_{n_k}) = M, so MM is attained. A similar argument applies to the infimum. The IVT is used implicitly in ensuring the limit point lies within the interval./07:_Intermediate_and_Extreme_Values/7.03:_The_Bolzano-Weierstrass_Theorem) Continuous functions also preserve connectedness: the image of a connected set under a continuous map is connected. In [25], connected sets are precisely the intervals, so the continuous image of an interval is again an interval.[26] To see this, suppose f:X→Yf: X \to Y is continuous with XX connected, and assume for contradiction that f(X)=A∪Bf(X) = A \cup B where AA and BB are nonempty, disjoint, open in f(X)f(X). Then f−1(A)f^{-1}(A) and f−1(B)f^{-1}(B) form a disconnection of XX, contradicting connectedness of XX.[27] Algebraic properties of continuous functions, such as closure under addition and multiplication, facilitate compositions in these proofs but are not central here./07:_Intermediate_and_Extreme_Values/7.03:_The_Bolzano-Weierstrass_Theorem)

Examples of continuous and discontinuous real functions

Standard continuous functions

Polynomials provide fundamental examples of functions that are continuous on the entire real line. Any polynomial function p:R→Rp: \mathbb{R} \to \mathbb{R} of the form p(x)=anxn+an−1xn−1+⋯+a1x+a0p(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0, where the aia_i are real coefficients and nn is a non-negative integer, is continuous everywhere on R\mathbb{R}. This continuity follows from the fact that constant functions and the identity function x↦xx \mapsto x are continuous, and finite sums and products of continuous functions are continuous./02%3A_Limits/2.06%3A_Continuity)[28] Rational functions, which are quotients of polynomials, are continuous on their domains where the denominator is nonzero. For instance, the function f(x)=1xf(x) = \frac{1}{x} is continuous on R∖{0}\mathbb{R} \setminus \{0\}, as it is the ratio of the constant polynomial 1 and the polynomial xx, both continuous where defined, and division preserves continuity away from zero. More generally, any rational function r(x)=p(x)q(x)r(x) = \frac{p(x)}{q(x)}, with polynomials pp and qq where q(x)≠0q(x) \neq 0, is continuous on its natural domain R∖{x∣q(x)=0}\mathbb{R} \setminus \{x \mid q(x) = 0\}.[29][30] The exponential function exe^x and the trigonometric functions sin⁡x\sin x and cos⁡x\cos x are also continuous on all of R\mathbb{R}. The exponential function can be defined via its power series ∑k=0∞xkk!\sum_{k=0}^\infty \frac{x^k}{k!}, a uniform limit of continuous polynomial partial sums, hence continuous. Similarly, sin⁡x=∑k=0∞(−1)kx2k+1(2k+1)!\sin x = \sum_{k=0}^\infty (-1)^k \frac{x^{2k+1}}{(2k+1)!} and cos⁡x=∑k=0∞(−1)kx2k(2k)!\cos x = \sum_{k=0}^\infty (-1)^k \frac{x^{2k}}{(2k)!} are continuous as uniform limits of continuous polynomials on compact intervals, extending to R\mathbb{R} by periodicity and other properties.[31][32] The absolute value function f(x)=∣x∣f(x) = |x| is continuous on R\mathbb{R}, including at x=0x=0. To verify continuity at 0 using the epsilon-delta definition, for any ε>0\varepsilon > 0, choose δ=ε\delta = \varepsilon; then if ∣x−0∣<δ|x - 0| < \delta, it follows that ∣∣x∣−∣0∣∣=∣x∣<ε| |x| - |0| | = |x| < \varepsilon. This simple choice of δ\delta confirms the limit condition holds.[33][34] Compositions of continuous functions yield further examples of continuous functions. For instance, the function g(x)=sin⁡(x2)g(x) = \sin(x^2) is continuous on R\mathbb{R} because it is the composition of the continuous function sin⁡u\sin u (with u∈Ru \in \mathbb{R}) and the continuous polynomial x2x^2, and the composition of continuous functions is continuous. Such examples illustrate how basic continuous building blocks can generate more complex continuous functions.[30][29]

Types of discontinuities

A discontinuity in a real-valued function occurs at a point aa in its domain where the function fails to be continuous, typically because the limit as xx approaches aa does not exist or does not equal the function value at aa. These points are classified based on the behavior of the one-sided limits and the overall limit.[35] Removable discontinuities arise when the limit of the function exists as xx approaches aa, but the function value at aa either does not exist or differs from that limit; redefining the function at aa to match the limit restores continuity. For example, consider f(x)=x2−1x−1f(x) = \frac{x^2 - 1}{x - 1} for x≠1x \neq 1; the limit as xx approaches 1 is 2, but f(1)f(1) is undefined, creating a removable discontinuity at x=1x = 1.[36][37] Jump discontinuities occur when both one-sided limits exist but are unequal, causing the function graph to "jump" across the point aa. The Heaviside step function, defined as H(x)=0H(x) = 0 for x<0x < 0 and H(x)=1H(x) = 1 for x≥0x \geq 0, exemplifies this with a jump discontinuity at x=0x = 0, where the left-hand limit is 0 and the right-hand limit is 1.[38] Essential discontinuities are more severe, where the limit as xx approaches aa fails to exist, often due to unbounded oscillation or divergence to infinity. The function f(x)=sin⁡(1/x)f(x) = \sin(1/x) for x≠0x \neq 0 has an essential discontinuity at x=0x = 0, as it oscillates infinitely often with amplitude 1, preventing any limit from existing.[39] Infinite discontinuities, a subtype of essential, involve limits approaching ±∞\pm \infty; for instance, f(x)=1/xf(x) = 1/x at x=0x = 0 diverges to ∞\infty from the right and −∞-\infty from the left.[40] The Dirichlet function, defined as D(x)=1D(x) = 1 if xx is rational and D(x)=0D(x) = 0 if xx is irrational, is discontinuous at every real number because rational and irrational numbers are dense in the reals, so no limit exists at any point.[41] Thomae's function, also known as the popcorn function, is defined on [0,1][0,1] by t(x)=1/qt(x) = 1/q if x=p/qx = p/q in lowest terms with q>0q > 0, and t(x)=0t(x) = 0 if xx is irrational; it is continuous at every irrational point but discontinuous at every rational point, as the function values at nearby rationals approach 0 while tt at the rational is positive.[42]

Continuity in metric spaces

Definition and basic properties

In metric spaces, the notion of continuity generalizes the epsilon-delta definition from real-valued functions, where the real line equipped with the absolute value metric serves as a special case.[43] Let (X,d)(X, d) and (Y,e)(Y, e) be metric spaces. A function f:X→Yf: X \to Y is continuous at a point a∈Xa \in X if for every ε>0\varepsilon > 0, there exists δ>0\delta > 0 such that d(x,a)<δd(x, a) < \delta implies e(f(x),f(a))<εe(f(x), f(a)) < \varepsilon. The function ff is continuous on XX if it is continuous at every point a∈Xa \in X.[43] This definition presupposes basic properties of metric spaces, such as the triangle inequality, and extends naturally to complete metric spaces (where every Cauchy sequence converges) as a foundation for further analysis, though completeness is not required for the definition itself.[43] An equivalent characterization of continuity in metric spaces uses sequences: ff is continuous at a∈Xa \in X if and only if, whenever a sequence (xn)(x_n) in XX converges to aa (i.e., d(xn,a)→0d(x_n, a) \to 0), the image sequence (f(xn))(f(x_n)) converges to f(a)f(a) in YY (i.e., e(f(xn),f(a))→0e(f(x_n), f(a)) \to 0).[44] This sequential criterion highlights a key property: continuous functions preserve limits of convergent sequences.[44] As an example, consider the distance function d(a,⋅):(X,d)→(R,∣⋅∣)d(a, \cdot): (X, d) \to (\mathbb{R}, |\cdot|) defined by f(x)=d(a,x)f(x) = d(a, x) for fixed a∈Xa \in X, where R\mathbb{R} uses the standard metric. This function is continuous at every point in XX. To verify continuity at aa, note that f(a)=0f(a) = 0; for ε>0\varepsilon > 0, choose δ=ε\delta = \varepsilon, so if d(x,a)<δd(x, a) < \delta, then ∣f(x)−f(a)∣=d(a,x)<ε|f(x) - f(a)| = d(a, x) < \varepsilon. Continuity at other points b∈Xb \in X follows from the triangle inequality: ∣d(a,x)−d(a,b)∣≤d(x,b)<δ|d(a, x) - d(a, b)| \leq d(x, b) < \delta with δ=ε\delta = \varepsilon.[45]

Notions of stronger continuity

In metric spaces, a stronger notion than pointwise continuity is uniform continuity, which requires the modulus of continuity to be independent of the location in the domain. Specifically, let (X,d)(X, d) and (Y,ρ)(Y, \rho) be metric spaces, and let f:X→Yf: X \to Y be a function. Then ff is uniformly continuous if for every ϵ>0\epsilon > 0, there exists δ>0\delta > 0 such that for all x,y∈Xx, y \in X, if d(x,y)<δd(x, y) < \delta, then ρ(f(x),f(y))<ϵ\rho(f(x), f(y)) < \epsilon.[46] This global control on the variation of ff ensures that close points in XX map to close points in YY uniformly across the entire domain. Lipschitz continuity provides an even stronger quantitative bound, where the distance in the codomain is controlled linearly by the distance in the domain. A function f:X→Yf: X \to Y is Lipschitz continuous if there exists a constant K≥0K \geq 0, called the Lipschitz constant, such that ρ(f(x),f(y))≤K d(x,y)\rho(f(x), f(y)) \leq K \, d(x, y) for all x,y∈Xx, y \in X.[47] If K<1K < 1, then ff is a contraction mapping, which guarantees a unique fixed point in complete metric spaces by the Banach fixed-point theorem.[48] Every Lipschitz continuous function is uniformly continuous, since for ϵ>0\epsilon > 0, one can take δ=ϵ/K\delta = \epsilon / K (assuming K>0K > 0). Hölder continuity generalizes Lipschitz continuity by allowing a power-law bound with exponent between 0 and 1. A function f:X→Yf: X \to Y is Hölder continuous with exponent α∈(0,1]\alpha \in (0, 1] if there exists K≥0K \geq 0 such that ρ(f(x),f(y))≤K[d(x,y)]α\rho(f(x), f(y)) \leq K [d(x, y)]^\alpha for all x,y∈Xx, y \in X.[49] When α=1\alpha = 1, this reduces to Lipschitz continuity; for α<1\alpha < 1, the bound is sublinear, permitting slower growth in the variation of ff compared to linear distances. Like Lipschitz continuity, Hölder continuity implies uniform continuity. A key result linking these notions is that every continuous function on a compact metric space is uniformly continuous. To see this, let f:X→Yf: X \to Y be continuous on the compact metric space (X,d)(X, d), and fix ϵ>0\epsilon > 0. For each x∈Xx \in X, continuity at xx yields r(x)>0r(x) > 0 such that if d(x,z)<r(x)d(x, z) < r(x), then ρ(f(x),f(z))<ϵ/2\rho(f(x), f(z)) < \epsilon/2. Consider the open cover {B(x;r(x)/2):x∈X}\{B(x; r(x)/2) : x \in X\} of XX, which has a finite subcover {B(pj;r(pj)/2):j=1,…,N}\{B(p_j; r(p_j)/2) : j = 1, \dots, N\} by compactness. Set δ=min⁡jr(pj)/2>0\delta = \min_j r(p_j)/2 > 0. For any x,y∈Xx, y \in X with d(x,y)<δd(x, y) < \delta, there exists pjp_j such that x∈B(pj;r(pj)/2)x \in B(p_j; r(p_j)/2), so d(x,pj)<r(pj)/2d(x, p_j) < r(p_j)/2. By the triangle inequality, d(y,pj)≤d(y,x)+d(x,pj)<δ+r(pj)/2≤r(pj)/2+r(pj)/2=r(pj)d(y, p_j) \leq d(y, x) + d(x, p_j) < \delta + r(p_j)/2 \leq r(p_j)/2 + r(p_j)/2 = r(p_j). Thus, ρ(f(x),f(pj))<ϵ/2\rho(f(x), f(p_j)) < \epsilon/2 and ρ(f(y),f(pj))<ϵ/2\rho(f(y), f(p_j)) < \epsilon/2, hence ρ(f(x),f(y))<ϵ\rho(f(x), f(y)) < \epsilon.[50] An illustrative example of a function that is continuous but not uniformly continuous is f(x)=x2f(x) = x^2 on R\mathbb{R} with the standard metric. To verify non-uniform continuity, fix ϵ=1\epsilon = 1. For any δ>0\delta > 0, choose u=1/δu = 1/\delta and x=1/δ+δ/2x = 1/\delta + \delta/2. Then ∣x−u∣=δ/2<δ|x - u| = \delta/2 < \delta, but ∣f(x)−f(u)∣=∣(1/δ+δ/2)2−(1/δ)2∣=∣1+δ2/4∣≥1=ϵ|f(x) - f(u)| = |(1/\delta + \delta/2)^2 - (1/\delta)^2| = |1 + \delta^2/4| \geq 1 = \epsilon. Thus, no such δ\delta works for all pairs.[51] Moreover, f(x)=xf(x) = \sqrt{x} on [0,1][0,1] is continuous (hence uniformly continuous by the theorem above) but not Lipschitz continuous, as the derivative f′(x)=1/(2x)f'(x) = 1/(2\sqrt{x}) is unbounded near 0, implying no global linear bound on the difference quotient.

Continuity in topological spaces

Open set definition

In topology, a function f:X→Yf: X \to Y between topological spaces (X,TX)(X, \mathcal{T}_X) and (Y,TY)(Y, \mathcal{T}_Y) is defined to be continuous if the preimage f−1(V)f^{-1}(V) of every open set V∈TYV \in \mathcal{T}_Y is an open set in XX, that is, f−1(V)∈TXf^{-1}(V) \in \mathcal{T}_X[https://ece.iisc.ac.in/~parimal/2015/proofs/lecture-17.pdf]. An equivalent characterization states that ff is continuous if and only if the preimage of every closed set in YY is closed in XX[https://ece.iisc.ac.in/~parimal/2015/proofs/lecture-17.pdf]. This definition generalizes the notion of continuity to the pointwise level: ff is continuous at a point a∈Xa \in X if for every open neighborhood VV of f(a)f(a) in YY, there exists an open neighborhood UU of aa in XX such that f(U)⊆Vf(U) \subseteq V[https://ece.iisc.ac.in/~parimal/2015/proofs/lecture-17.pdf]. The open set formulation offers key advantages over the ϵ\epsilon-δ\delta definition from metric spaces, as it expresses continuity purely in topological terms without relying on distances, thereby extending naturally to arbitrary topological spaces, including non-metrizable ones such as the space of all functions from R\mathbb{R} to R\mathbb{R} equipped with the topology of pointwise convergence[https://people.math.harvard.edu/~elkies/M55a.02/pdflatex/top3.pdf][https://faculty.arts.ubc.ca/pschrimpf/526/metricSpaces-526.pdf]. Representative examples illustrate the definition's application. The identity function idX:X→X\mathrm{id}_X: X \to X, defined by idX(x)=x\mathrm{id}_X(x) = x for all x∈Xx \in X, is continuous because the preimage of any open set U⊆XU \subseteq X is UU itself, which is open[https://math.wvu.edu/~jwojciec/teaching_files/2024_Spring-581/node-6.html]. Similarly, any constant function f:X→Yf: X \to Y with f(x)=cf(x) = c for some fixed c∈Yc \in Y and all x∈Xx \in X is continuous: for an open V⊆YV \subseteq Y, if c∈Vc \in V then f−1(V)=Xf^{-1}(V) = X, which is open, and if c∉Vc \notin V then f−1(V)=∅f^{-1}(V) = \emptyset, which is also open[https://people.math.harvard.edu/~elkies/M55a.02/pdflatex/top3.pdf]. To connect with the metric case, the ϵ\epsilon-δ\delta definition of continuity for functions f:R→Rf: \mathbb{R} \to \mathbb{R} implies the open set definition. Suppose ff is continuous at every point via ϵ\epsilon-δ\delta: for any open interval (a,b)⊆R(a, b) \subseteq \mathbb{R}, consider x∈f−1((a,b))x \in f^{-1}((a, b)), so f(x)∈(a,b)f(x) \in (a, b). Let ϵ=min⁡{f(x)−a,b−f(x)}>0\epsilon = \min\{f(x) - a, b - f(x)\} > 0; then there exists δ>0\delta > 0 such that if ∣y−x∣<δ|y - x| < \delta, then ∣f(y)−f(x)∣<ϵ|f(y) - f(x)| < \epsilon, ensuring f((x−δ,x+δ))⊆(a,b)f((x - \delta, x + \delta)) \subseteq (a, b). Thus, (x−δ,x+δ)⊆f−1((a,b))(x - \delta, x + \delta) \subseteq f^{-1}((a, b)), showing f−1((a,b))f^{-1}((a, b)) is open as a union of such intervals. Since open sets in R\mathbb{R} are unions of open intervals, the preimage of any open set is open[https://www.math.colostate.edu/~clayton/courses/500/500_1.pdf].

Alternative characterizations

In topological spaces, continuity of a function f:X→Yf: X \to Y can be equivalently characterized using nets, which generalize sequences to directed sets and are particularly useful in spaces lacking a countable local basis at points. A net in XX is a function xλ:Λ→Xx_\lambda: \Lambda \to X, where Λ\Lambda is a directed set, and it converges to a point a∈Xa \in X if for every open neighborhood UU of aa, there exists λ0∈Λ\lambda_0 \in \Lambda such that xλ∈Ux_\lambda \in U for all λ≥λ0\lambda \geq \lambda_0. The function ff is continuous at aa if and only if for every net xλ→ax_\lambda \to a in XX, the image net f(xλ)→f(a)f(x_\lambda) \to f(a) in YY.[52] This extends the sequential characterization of continuity, which holds in first-countable spaces but fails more generally, as nets capture all possible "approaches" to a point regardless of countability assumptions.[52] Filters provide another equivalent formulation, generalizing the neighborhood filterbases used in pointwise convergence. A filter F\mathcal{F} on XX is a collection of subsets satisfying: it is upward closed, closed under finite intersections, and does not contain the empty set; the filter converges to a∈Xa \in X if every set in F\mathcal{F} contains an open neighborhood of aa. The function ff is continuous at aa if and only if for every filter F\mathcal{F} on XX converging to aa, the image filter f(F)={f(F)∣F∈F}f(\mathcal{F}) = \{f(F) \mid F \in \mathcal{F}\} converges to f(a)f(a) in YY.[53] Like nets, filters are indispensable in non-sequential spaces, where sequences alone cannot detect all limits or ensure continuity preservation.[53] Continuity also admits characterizations in terms of closure and interior operators derived from the topology. The closure operator clX\mathrm{cl}_X assigns to each subset A⊆XA \subseteq X its smallest closed superset, and similarly for clY\mathrm{cl}_Y. The function ff is continuous if and only if f(clX(A))⊆clY(f(A))f(\mathrm{cl}_X(A)) \subseteq \mathrm{cl}_Y(f(A)) for every A⊆XA \subseteq X.[54] Dually, the interior operator intX\mathrm{int}_X assigns to each subset its largest open subset, and ff is continuous if and only if intX(f−1(B))⊇f−1(intY(B))\mathrm{int}_X(f^{-1}(B)) \supseteq f^{-1}(\mathrm{int}_Y(B)) for every B⊆YB \subseteq Y.[54] These operator-based equivalents stem directly from the open-set definition of continuity and are often leveraged in proofs involving preserved topological properties like compactness or connectedness. Nets prove essential in non-first-countable spaces, such as the ordinal topology on [0,ω1][0, \omega_1], where ω1\omega_1 is the first uncountable ordinal equipped with basis elements (α,β)( \alpha, \beta ) for limit ordinals and half-open intervals otherwise. This space is not first-countable at ω1\omega_1, as no countable collection of neighborhoods forms a local basis there; sequences converging to ω1\omega_1 must be eventually constant, failing to capture cofinal approaches. However, the net indexed by ordinals α<ω1\alpha < \omega_1 with xα=αx_\alpha = \alpha converges to ω1\omega_1, illustrating how nets detect continuity at such points where sequences cannot.[55] For instance, the identity function from [0,ω1][0, \omega_1] to itself is continuous via the net characterization, preserving this cofinal convergence, though sequential continuity would inadequately verify it.[55]

Limits of continuous functions

A sequence of continuous functions may converge pointwise to a discontinuous function. For example, consider the sequence fn(x)=xnf_n(x) = x^n on the interval [0,1][0,1]. Each fnf_n is continuous, but the pointwise limit f(x)=0f(x) = 0 for x∈[0,1)x \in [0,1) and f(1)=1f(1) = 1 is discontinuous at x=1x=1.[56] In contrast, uniform convergence preserves continuity. If a sequence of continuous functions {fn}\{f_n\} converges uniformly to a function ff on a set EE, then ff is continuous on EE. To see this, fix x0∈Ex_0 \in E and ϵ>0\epsilon > 0. Since fn→ff_n \to f uniformly, there exists NN such that for all n>Nn > N and all x∈Ex \in E, ∣fn(x)−f(x)∣<ϵ/3|f_n(x) - f(x)| < \epsilon/3. Choose n>Nn > N fixed; since fnf_n is continuous at x0x_0, there exists δ>0\delta > 0 such that if ∣x−x0∣<δ|x - x_0| < \delta, then ∣fn(x)−fn(x0)∣<ϵ/3|f_n(x) - f_n(x_0)| < \epsilon/3. Thus, for ∣x−x0∣<δ|x - x_0| < \delta,
∣f(x)−f(x0)∣≤∣f(x)−fn(x)∣+∣fn(x)−fn(x0)∣+∣fn(x0)−f(x0)∣<ϵ, |f(x) - f(x_0)| \leq |f(x) - f_n(x)| + |f_n(x) - f_n(x_0)| + |f_n(x_0) - f(x_0)| < \epsilon,
where the δ\delta is independent of the uniform convergence index but relies on the continuity of fnf_n.[57] Dini's theorem provides a condition under which pointwise convergence of continuous functions implies uniform convergence. Specifically, if {fn}\{f_n\} is a monotone sequence of continuous real-valued functions on a compact set KK that converges pointwise to a continuous function ff on KK, then the convergence is uniform on KK. This result is particularly useful for sequences that are either non-decreasing or non-increasing.[58] Fourier series illustrate the distinction between pointwise and uniform convergence. The partial sums of the Fourier series of a continuous periodic function converge pointwise to the function under certain conditions, such as piecewise smoothness, but the convergence is generally not uniform, particularly near points where higher derivatives are discontinuous.[59] In metric spaces, the relation between limits of continuous functions and completeness arises in the space of continuous functions equipped with the uniform metric. The set C(X,R)C(X, \mathbb{R}) of continuous real-valued functions on a compact metric space XX, normed by the supremum metric d(f,g)=sup⁡x∈X∣f(x)−g(x)∣d(f,g) = \sup_{x \in X} |f(x) - g(x)|, forms a complete metric space; thus, uniform limits of Cauchy sequences in this space remain continuous.[60]

Semicontinuity and one-sided continuity

A function f:D→Rf: D \to \mathbb{R} defined on a subset DD of R\mathbb{R} is lower semicontinuous at a point a∈Da \in D if lim inf⁡x→af(x)≥f(a)\liminf_{x \to a} f(x) \geq f(a).[61] This condition ensures that the function values near aa do not drop significantly below f(a)f(a). Equivalently, ff is lower semicontinuous at aa if for every α∈R\alpha \in \mathbb{R}, the superlevel set {x∈D:f(x)>α}\{x \in D : f(x) > \alpha\} is open relative to DD, or if the sublevel sets {x∈D:f(x)≤α}\{x \in D : f(x) \leq \alpha\} are closed relative to DD.[61] The dual notion is upper semicontinuity, where ff is upper semicontinuous at aa if lim sup⁡x→af(x)≤f(a)\limsup_{x \to a} f(x) \leq f(a).[61] This means function values near aa do not exceed f(a)f(a) by much. An equivalent characterization is that for every α∈R\alpha \in \mathbb{R}, the strict sublevel set {x∈D:f(x)<α}\{x \in D : f(x) < \alpha\} is open relative to DD, or the superlevel sets {x∈D:f(x)≥α}\{x \in D : f(x) \geq \alpha\} are closed relative to DD.[61] A function is continuous at aa if and only if it is both lower and upper semicontinuous at aa. One-sided continuity relaxes the two-sided limit requirement by considering approaches from only the left or right. A function ff is right-continuous at aa if lim⁡x→a+f(x)=f(a)\lim_{x \to a^+} f(x) = f(a), and left-continuous at aa if lim⁡x→a−f(x)=f(a)\lim_{x \to a^-} f(x) = f(a).[62] For example, the floor function ⌊x⌋\lfloor x \rfloor, which maps xx to the greatest integer less than or equal to xx, is right-continuous at every integer nn, since as xx approaches nn from the right, ⌊x⌋=n=⌊n⌋\lfloor x \rfloor = n = \lfloor n \rfloor, but discontinuous from the left.[63] Lower semicontinuous functions have useful optimization properties. On a compact subset KK of the domain, a lower semicontinuous function attains its minimum value, generalizing the extreme value theorem for continuous functions.[64] For instance, the function f(x)=0f(x) = 0 if x<0x < 0 and f(x)=xf(x) = x if x≥0x \geq 0 is continuous everywhere, including at x=0x=0, but its one-sided limits illustrate the behavior: the right limit at 0 is 0, matching f(0)f(0), while the left limit is also 0.[62]