Fact-checked by Grok 2 weeks ago

Continuous function

In mathematics, particularly in and , 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. Formally, a function f: D \to \mathbb{R}, where D \subseteq \mathbb{R} is the domain, is continuous at a point a \in D if \lim_{x \to a} f(x) = f(a), meaning the function value at a matches the limit of the function values approaching a. This limit condition is rigorously captured by the epsilon-delta definition, introduced by Karl Weierstrass and Camille Jordan: for every \epsilon > 0, there exists a \delta > 0 such that if $0 < |x - a| < \delta and x \in D, then |f(x) - f(a)| < \epsilon. A function is continuous on a set if it is continuous at every point in that set, with the entire domain often implying everywhere unless specified otherwise. 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 who first formalized it in 1821 as functions taking nearby values at nearby points. 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. By the late 19th century, examples like 's 1872 construction of a continuous but nowhere differentiable function challenged assumptions about smoothness, highlighting the depth of the concept. 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. 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. On compact intervals (closed and bounded sets), continuous functions are bounded and attain their maximum and minimum values, as per the . Additionally, they satisfy the , guaranteeing that the function takes every value between f(a) and f(b) for any a < b in the domain. These attributes make continuous functions indispensable in applications ranging from physics modeling smooth motions to engineering optimizations, where abrupt discontinuities could invalidate predictions.

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, 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. , 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. 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 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. In the 17th and 18th centuries, European mathematicians like and developed more dynamic intuitive views of continuity, likening functions to flowing quantities. articulated the , 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. , 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.

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 . 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 . 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. 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 a such that for every \epsilon > 0, there exists a \delta > 0 where if |x - a| < \delta, then |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. 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) = 1 if x is rational and f(x) = 0 if x 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.

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 \to \mathbb{R}, where D \subseteq \mathbb{R}, is continuous at a point a \in D if for every \epsilon > 0, there exists a \delta > 0 such that whenever x \in D and |x - a| < \delta, it follows that |f(x) - f(a)| < \epsilon. This formulation was first fully articulated by Karl Weierstrass in his 1861 lectures on calculus. The logical structure of the definition emphasizes the universal and existential quantifiers: \forall \epsilon > 0 \, \exists \delta > 0 \, \forall x \in D \left( |x - a| < \delta \implies |f(x) - f(a)| < \epsilon \right). 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 x guarantees the implication for all points sufficiently close to a within the domain. This definition motivates continuity by precisely encoding the idea that arbitrarily small perturbations in the input near a result in output values arbitrarily close to f(a), eliminating ambiguities in intuitive descriptions like "no jumps or breaks." For example, consider verifying continuity of the identity function f(x) = x on \mathbb{R} at any point a \in \mathbb{R}. Given \epsilon > 0, select \delta = \epsilon. Then, for any x \in \mathbb{R} with |x - a| < \delta, it holds that |f(x) - f(a)| = |x - a| < \epsilon, satisfying the definition. Domain considerations are integral to the definition, as the condition applies only to points x in D near a, 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], continuity at the endpoints b and c requires the implication to hold for x approaching from within the interval.

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.

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.

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).

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.

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.

Properties of continuous real-valued functions

Algebraic and order properties

Continuous real-valued functions exhibit closure under various algebraic operations. Specifically, if f and g are continuous at a point a in their common domain, then their sum f + g, defined by (f + g)(x) = f(x) + g(x), is continuous at a. Similarly, the product f \cdot g, defined by (f \cdot g)(x) = f(x) g(x), is continuous at a. For scalar multiplication, if c is a real constant, then c f, defined by (c f)(x) = c f(x), is continuous at a whenever f is. Moreover, the quotient f / g, defined by (f / g)(x) = f(x) / g(x) where g(x) \neq 0, is continuous at a provided g(a) \neq 0. These properties follow from the preservation of limits under addition, multiplication, and division in the , 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 f is continuous at a and g is continuous at f(a), then the composition g \circ f, defined by (g \circ f)(x) = g(f(x)), is continuous at a. This arises because the limit of f(x) as x approaches a is f(a), and substituting into g preserves the limit due to g'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 f is continuous at a, then |f|, defined by |f|(x) = |f(x)|, is continuous at a. This can be seen by expressing |f|(x) = \sqrt{f(x)^2}, where squaring and the square root function (continuous on [0, \infty)) are both continuous operations./03%3A_Limits_and_Continuity/3.04%3A_Properties_of_Continuous_Functions) Regarding order properties, if f and g are continuous functions on a domain and satisfy f(x) \leq g(x) for all x 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 f is continuous and strictly increasing on an interval I, then for all x, y \in I with x < y, it holds that f(x) < f(y). Furthermore, such functions map connected intervals to connected intervals; specifically, f maps an interval I \subseteq \mathbb{R} onto the interval [ \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 \mathbb{R}.

Key theorems

The Intermediate Value Theorem (IVT) asserts that if f is a continuous function on the closed interval [a, b] and k is any real number between f(a) and f(b), then there exists some c \in [a, b] such that f(c) = k. This theorem, first rigorously proved by in 1817, captures the intuitive notion that continuous functions on intervals cannot "skip" values. 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). Bisect the interval at the midpoint m = (a + b)/2; if f(m) = k, then c = m, otherwise replace either [a, m] or [m, b] with the subinterval where k lies between the endpoint values. Repeating this process generates a sequence of nested closed intervals [a_n, b_n] with lengths approaching zero and f(a_n) < k < f(b_n) for all n. By the nested interval theorem, which follows from the least upper bound property of \mathbb{R}, the intersection \bigcap [a_n, b_n] is a single point c, and continuity ensures f(c) = k. The Extreme Value Theorem (EVT) states that if f is continuous on the compact interval [a, b], then f attains its maximum and minimum values on [a, b]. This result, established by Karl Weierstrass in the 1860s, guarantees the existence of global extrema for continuous functions on closed bounded domains. The Heine-Borel theorem provides the key fact that closed and bounded intervals in \mathbb{R} are compact: every open cover of [a, b] has a finite subcover. To prove the EVT, first note that continuity implies f is bounded on [a, b] (by the Heine-Borel property and uniform continuity on compact sets), so the supremum M = \sup_{x \in [a, b]} f(x) is finite. Consider the sequence x_n where f(x_n) > M - 1/n; by the Bolzano-Weierstrass , it has a convergent x_{n_k} \to c \in [a, b]. yields f(c) = \lim f(x_{n_k}) = M, so M 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 , connected sets are precisely the , so the continuous image of an is again an . To see this, suppose f: X \to Y is continuous with X connected, and assume for contradiction that f(X) = A \cup B where A and B are nonempty, disjoint, open in f(X). Then f^{-1}(A) and f^{-1}(B) form a disconnection of X, contradicting connectedness of X. Algebraic properties of continuous functions, such as closure under and , 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

provide fundamental examples of functions that are continuous on the entire real line. Any function p: \mathbb{R} \to \mathbb{R} of the form p(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0, where the a_i are real coefficients and n is a non-negative , is continuous everywhere on \mathbb{R}. This continuity follows from the fact that constant functions and the x \mapsto x are continuous, and finite sums and products of continuous functions are continuous./02%3A_Limits/2.06%3A_Continuity) Rational functions, which are quotients of , are continuous on their domains where the denominator is nonzero. For instance, the function f(x) = \frac{1}{x} is continuous on \mathbb{R} \setminus \{0\}, as it is the ratio of the constant polynomial 1 and the polynomial x, both continuous where defined, and division preserves continuity away from zero. More generally, any rational function r(x) = \frac{p(x)}{q(x)}, with p and q where q(x) \neq 0, is continuous on its natural domain \mathbb{R} \setminus \{x \mid q(x) = 0\}. The e^x and the \sin x and \cos x are also continuous on all of \mathbb{R}. The exponential function can be defined via its \sum_{k=0}^\infty \frac{x^k}{k!}, a limit of continuous partial sums, hence continuous. Similarly, \sin x = \sum_{k=0}^\infty (-1)^k \frac{x^{2k+1}}{(2k+1)!} and \cos x = \sum_{k=0}^\infty (-1)^k \frac{x^{2k}}{(2k)!} are continuous as limits of continuous polynomials on compact intervals, extending to \mathbb{R} by periodicity and other properties. The f(x) = |x| is continuous on \mathbb{R}, including at x=0. To verify at 0 using the epsilon- , for any \varepsilon > 0, choose \delta = \varepsilon; then if |x - 0| < \delta, it follows that | |x| - |0| | = |x| < \varepsilon. This simple choice of \delta confirms the limit condition holds. Compositions of continuous functions yield further examples of continuous functions. For instance, the function g(x) = \sin(x^2) is continuous on \mathbb{R} because it is the composition of the continuous function \sin u (with u \in \mathbb{R}) and the continuous polynomial x^2, and the composition of continuous functions is continuous. Such examples illustrate how basic continuous building blocks can generate more complex continuous functions.

Types of discontinuities

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

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. Let (X, d) and (Y, e) be metric spaces. A function f: X \to Y is continuous at a point a \in X if for every \varepsilon > 0, there exists \delta > 0 such that d(x, a) < \delta implies e(f(x), f(a)) < \varepsilon. The function f is continuous on X if it is continuous at every point a \in X. 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. An equivalent characterization of continuity in metric spaces uses sequences: f is continuous at a \in X if and only if, whenever a sequence (x_n) in X converges to a (i.e., d(x_n, a) \to 0), the image sequence (f(x_n)) converges to f(a) in Y (i.e., e(f(x_n), f(a)) \to 0). This sequential criterion highlights a key property: continuous functions preserve limits of convergent sequences. As an example, consider the distance function d(a, \cdot): (X, d) \to (\mathbb{R}, |\cdot|) defined by f(x) = d(a, x) for fixed a \in X, where \mathbb{R} uses the standard metric. This function is continuous at every point in X. To verify continuity at a, note that f(a) = 0; for \varepsilon > 0, choose \delta = \varepsilon, so if d(x, a) < \delta, then |f(x) - f(a)| = d(a, x) < \varepsilon. Continuity at other points b \in X follows from the triangle inequality: |d(a, x) - d(a, b)| \leq d(x, b) < \delta with \delta = \varepsilon.

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) and (Y, \rho) be metric spaces, and let f: X \to Y be a function. Then f is uniformly continuous if for every \epsilon > 0, there exists \delta > 0 such that for all x, y \in X, if d(x, y) < \delta, then \rho(f(x), f(y)) < \epsilon. This global control on the variation of f ensures that close points in X map to close points in Y 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 \to Y is Lipschitz continuous if there exists a constant K \geq 0, called the Lipschitz constant, such that \rho(f(x), f(y)) \leq K \, d(x, y) for all x, y \in X. If K < 1, then f is a contraction mapping, which guarantees a unique fixed point in complete metric spaces by the . Every Lipschitz continuous function is uniformly continuous, since for \epsilon > 0, one can take \delta = \epsilon / K (assuming K > 0). Hölder continuity generalizes by allowing a power-law bound with exponent between 0 and 1. A f: X \to Y is Hölder continuous with exponent \alpha \in (0, 1] if there exists K \geq 0 such that \rho(f(x), f(y)) \leq K [d(x, y)]^\alpha for all x, y \in X. When \alpha = 1, this reduces to ; for \alpha < 1, the bound is sublinear, permitting slower growth in the variation of f compared to linear distances. Like , 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 \to Y be continuous on the compact metric space (X, d), and fix \epsilon > 0. For each x \in X, continuity at x yields r(x) > 0 such that if d(x, z) < r(x), then \rho(f(x), f(z)) < \epsilon/2. Consider the open cover \{B(x; r(x)/2) : x \in X\} of X, which has a finite subcover \{B(p_j; r(p_j)/2) : j = 1, \dots, N\} by compactness. Set \delta = \min_j r(p_j)/2 > 0. For any x, y \in X with d(x, y) < \delta, there exists p_j such that x \in B(p_j; r(p_j)/2), so d(x, p_j) < r(p_j)/2. By the triangle inequality, 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, \rho(f(x), f(p_j)) < \epsilon/2 and \rho(f(y), f(p_j)) < \epsilon/2, hence \rho(f(x), f(y)) < \epsilon. An illustrative example of a function that is continuous but not uniformly continuous is f(x) = x^2 on \mathbb{R} with the standard metric. To verify non-uniform continuity, fix \epsilon = 1. For any \delta > 0, choose u = 1/\delta and x = 1/\delta + \delta/2. Then |x - u| = \delta/2 < \delta, but |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. Moreover, f(x) = \sqrt{x} on [0,1] is continuous (hence uniformly continuous by the theorem above) but not Lipschitz continuous, as the derivative 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 \to Y between topological spaces (X, \mathcal{T}_X) and (Y, \mathcal{T}_Y) is defined to be continuous if the preimage f^{-1}(V) of every open set V \in \mathcal{T}_Y is an open set in X, that is, f^{-1}(V) \in \mathcal{T}_X. An equivalent characterization states that f is continuous if and only if the preimage of every closed set in Y is closed in X. This definition generalizes the notion of continuity to the pointwise level: f is continuous at a point a \in X if for every open neighborhood V of f(a) in Y, there exists an open neighborhood U of a in X such that f(U) \subseteq V. 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 \mathbb{R} to \mathbb{R} equipped with the topology of pointwise convergence. Representative examples illustrate the definition's application. The identity function \mathrm{id}_X: X \to X, defined by \mathrm{id}_X(x) = x for all x \in X, is continuous because the preimage of any open set U \subseteq X is U itself, which is open. Similarly, any constant function f: X \to Y with f(x) = c for some fixed c \in Y and all x \in X is continuous: for an open V \subseteq Y, if c \in V then f^{-1}(V) = X, which is open, and if c \notin V then f^{-1}(V) = \emptyset, which is also open. To connect with the metric case, the \epsilon-\delta definition of continuity for functions f: \mathbb{R} \to \mathbb{R} implies the open set definition. Suppose f is continuous at every point via \epsilon-\delta: for any open interval (a, b) \subseteq \mathbb{R}, consider x \in f^{-1}((a, b)), so f(x) \in (a, b). Let \epsilon = \min\{f(x) - a, b - f(x)\} > 0; then there exists \delta > 0 such that if |y - x| < \delta, then |f(y) - f(x)| < \epsilon, ensuring f((x - \delta, x + \delta)) \subseteq (a, b). Thus, (x - \delta, x + \delta) \subseteq f^{-1}((a, b)), showing f^{-1}((a, b)) is open as a union of such intervals. Since open sets in \mathbb{R} are unions of open intervals, the preimage of any open set is open.

Alternative characterizations

In topological spaces, continuity of a function f: 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 X is a function x_\lambda: \Lambda \to X, where \Lambda is a directed set, and it converges to a point a \in X if for every open neighborhood U of a, there exists \lambda_0 \in \Lambda such that x_\lambda \in U for all \lambda \geq \lambda_0. The function f is continuous at a if and only if for every net x_\lambda \to a in X, the image net f(x_\lambda) \to f(a) in Y. 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. Filters provide another equivalent formulation, generalizing the neighborhood filterbases used in pointwise convergence. A filter \mathcal{F} on X 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 \in X if every set in \mathcal{F} contains an open neighborhood of a. The function f is continuous at a if and only if for every filter \mathcal{F} on X converging to a, the image filter f(\mathcal{F}) = \{f(F) \mid F \in \mathcal{F}\} converges to f(a) in Y. Like nets, filters are indispensable in non-sequential spaces, where sequences alone cannot detect all limits or ensure continuity preservation. Continuity also admits characterizations in terms of closure and interior operators derived from the topology. The closure operator \mathrm{cl}_X assigns to each subset A \subseteq X its smallest closed superset, and similarly for \mathrm{cl}_Y. The function f is continuous if and only if f(\mathrm{cl}_X(A)) \subseteq \mathrm{cl}_Y(f(A)) for every A \subseteq X. Dually, the interior operator \mathrm{int}_X assigns to each subset its largest open subset, and f is continuous if and only if \mathrm{int}_X(f^{-1}(B)) \supseteq f^{-1}(\mathrm{int}_Y(B)) for every B \subseteq Y. 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, \omega_1], where \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 \omega_1, as no countable collection of neighborhoods forms a local basis there; sequences converging to \omega_1 must be eventually constant, failing to capture cofinal approaches. However, the net indexed by ordinals \alpha < \omega_1 with x_\alpha = \alpha converges to \omega_1, illustrating how nets detect continuity at such points where sequences cannot. For instance, the identity function from [0, \omega_1] to itself is continuous via the net characterization, preserving this cofinal convergence, though sequential continuity would inadequately verify it.

Limits of continuous functions

A sequence of continuous functions may converge pointwise to a discontinuous function. For example, consider the sequence f_n(x) = x^n on the interval [0,1]. Each f_n is continuous, but the pointwise limit f(x) = 0 for x \in [0,1) and f(1) = 1 is discontinuous at x=1. In contrast, uniform convergence preserves continuity. If a sequence of continuous functions \{f_n\} converges uniformly to a function f on a set E, then f is continuous on E. To see this, fix x_0 \in E and \epsilon > 0. Since f_n \to f uniformly, there exists N such that for all n > N and all x \in E, |f_n(x) - f(x)| < \epsilon/3. Choose n > N fixed; since f_n is continuous at x_0, there exists \delta > 0 such that if |x - x_0| < \delta, then |f_n(x) - f_n(x_0)| < \epsilon/3. Thus, for |x - x_0| < \delta, |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 f_n. Dini's theorem provides a condition under which pointwise convergence of continuous functions implies uniform convergence. Specifically, if \{f_n\} is a monotone sequence of continuous real-valued functions on a compact set K that converges pointwise to a continuous function f on K, then the convergence is uniform on K. This result is particularly useful for sequences that are either non-decreasing or non-increasing. 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. 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, \mathbb{R}) of continuous real-valued functions on a compact metric space X, normed by the supremum metric 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.

Semicontinuity and one-sided continuity

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