Definition defined on the reals. A
real function that is a
function from
real numbers to real numbers can be represented by a
graph in the
Cartesian plane; such a function is continuous if, roughly speaking, the graph is a single unbroken
curve whose
domain is the entire real line. A more mathematically rigorous definition is given below. Continuity of real functions is usually defined in terms of
limits. A function with variable is
continuous at the
real number , if the limit of f(x), as tends to , is equal to f(c). There are several different definitions of the (global) continuity of a function, which depend on the nature of its
domain. A function is continuous on an
open interval if the interval is contained in the function's domain and the function is continuous at every interval point. A function that is continuous on the interval (-\infty, +\infty) (the whole
real line) is often called simply a continuous function; one also says that such a function is
continuous everywhere. For example, all
polynomial functions are continuous everywhere. A function is continuous on a
semi-open or a
closed interval; if the interval is contained in the domain of the function, the function is continuous at every interior point of the interval, and the value of the function at each endpoint that belongs to the interval is the limit of the values of the function when the variable tends to the endpoint from the interior of the interval. For example, the function f(x) = \sqrt{x} is continuous on its whole domain, which is the semi-open interval [0,+\infty). Many commonly encountered functions are
partial functions that have a domain formed by all real numbers, except some
isolated points. Examples include the
reciprocal function x \mapsto \frac {1}{x} and the
tangent function x\mapsto \tan x. When they are continuous on their domain, one says, in some contexts, that they are continuous, although they are not continuous everywhere. In other contexts, mainly when one is interested in their behavior near the exceptional points, one says they are discontinuous. A partial function is
discontinuous at a point if the point belongs to the
topological closure of its domain, and either the point does not belong to the domain of the function or the function is not continuous at the point. For example, the functions x\mapsto \frac {1}{x} and x\mapsto \sin(\frac {1}{x}) are discontinuous at , and remain discontinuous whichever value is chosen for defining them at . A point where a function is discontinuous is called a
discontinuity. Using mathematical notation, several ways exist to define continuous functions in the three senses mentioned above. Let f : D \to \R be a function whose
domain D is contained in \R of real numbers. Some (but not all) possibilities for D are: • D is the whole
real line; that is, D = \R • D is a
closed interval of the form D = [a, b] = \{x \in \R \mid a \leq x \leq b \} , where and are real numbers • D is an
open interval of the form D = (a, b) = \{x \in \R \mid a where and are real numbers In the case of an open interval, a and b do not belong to D, and the values f(a) and f(b) are not defined, and if they are, they do not matter for continuity on D.
Definition in terms of limits of functions The function is
continuous at some point of its domain if the
limit of f(x), as
x approaches
c through the domain of
f, exists and is equal to f(c). In mathematical notation, this is written as \lim_{x \to c}{f(x)} = f(c). In detail this means three conditions: first, has to be defined at (guaranteed by the requirement that be in the domain of ). Second, the limit of that equation has to exist. Third, the value of this limit must equal f(c). (Here, we have assumed that the domain of
f does not have any
isolated points.)
Definition in terms of neighborhoods A
neighborhood of a point
c is a set that contains, at least, all points within some fixed distance of
c. Intuitively, a function is continuous at a point
c if the range of
f over the neighborhood of
c shrinks to a single point f(c) as the width of the neighborhood around
c shrinks to zero. More precisely, a function
f is continuous at a point
c of its domain if, for any neighborhood N_1(f(c)) there is a neighborhood N_2(c) in its domain such that f(x) \in N_1(f(c)) whenever x\in N_2(c). As neighborhoods are defined in any
topological space, this definition of a continuous function applies not only for real functions but also when the domain and the
codomain are
topological spaces and is thus the most general definition. It follows that a function is automatically continuous at every
isolated point of its domain. For example, every real-valued function on the integers is continuous.
Definition in terms of limits of sequences One can instead require that for any
sequence (x_n)_{n \in \N} of points in the domain which
converges to
c, the corresponding sequence \left(f(x_n)\right)_{n\in \N} converges to f(c). In mathematical notation, \forall (x_n)_{n \in \N} \subset D:\lim_{n\to\infty} x_n = c \Rightarrow \lim_{n\to\infty} f(x_n) = f(c)\,.
Weierstrass and Jordan definitions (epsilon–delta) of continuous functions Explicitly including the definition of the limit of a function, we obtain a self-contained definition: Given a function f : D \to \mathbb{R} as above and an element x_0 of the domain D, f is said to be continuous at the point x_0 when the following holds: For any positive real number \varepsilon > 0, however small, there exists some positive real number \delta > 0 such that for all x in the domain of f with x_0 - \delta the value of f(x) satisfies f\left(x_0\right) - \varepsilon Alternatively written, continuity of f : D \to \mathbb{R} at x_0 \in D means that for every \varepsilon > 0, there exists a \delta > 0 such that for all x \in D: \left|x - x_0\right| More intuitively, we can say that if we want to get all the f(x) values to stay in some small
neighborhood around f\left(x_0\right), we need to choose a small enough neighborhood for the x values around x_0. If we can do that no matter how small the f(x_0) neighborhood is, then f is continuous at x_0. In modern terms, this is generalized by the definition of continuity of a function with respect to a
basis for the topology, here the
metric topology.
Weierstrass had required that the interval x_0 - \delta be entirely within the domain D, but Jordan removed that restriction.
Definition in terms of control of the remainder In proofs and numerical analysis, we often need to know how fast limits are converging, or in other words, control of the remainder. We can formalize this to a definition of continuity. A function C: [0,\infty) \to [0,\infty] is called a control function if •
C is non-decreasing • \inf_{\delta > 0} C(\delta) = 0 A function f : D \to R is
C-continuous at x_0 if there exists such a neighbourhood N(x_0) that |f(x) - f(x_0)| \leq C\left(\left|x - x_0\right|\right) \text{ for all } x \in D \cap N(x_0) A function is continuous in x_0 if it is
C-continuous for some control function
C. This approach leads naturally to refining the notion of continuity by restricting the set of admissible control functions. For a given set of control functions \mathcal{C} a function is {{nowrap|\mathcal{C}-continuous}} if it is for some C \in \mathcal{C}. For example, the
Lipschitz, the
Hölder continuous functions of exponent and the
uniformly continuous functions below are defined by the set of control functions \mathcal{C}_{\mathrm{Lipschitz}} = \{C : C(\delta) = K|\delta| ,\ K > 0\} \mathcal{C}_{\text{Hölder}-\alpha} = \{C : C(\delta) = K |\delta|^\alpha, \ K > 0\} \mathcal{C}_{\text{uniform cont.}} = \{C : C(0) = 0 \} respectively.
Definition using oscillation . Continuity can also be defined in terms of
oscillation: a function
f is continuous at a point x_0 if and only if its oscillation at that point is zero; in symbols, \omega_f(x_0) = 0. A benefit of this definition is that it discontinuity: the oscillation gives how the function is discontinuous at a point. This definition is helpful in
descriptive set theory to study the set of discontinuities and continuous points – the continuous points are the intersection of the sets where the oscillation is less than \varepsilon (hence a
G_{\delta} set) – and gives a rapid proof of one direction of the
Lebesgue integrability condition. The oscillation is equivalent to the \varepsilon-\delta definition by a simple re-arrangement and by using a limit (
lim sup,
lim inf) to define oscillation: if (at a given point) for a given \varepsilon_0 there is no \delta that satisfies the \varepsilon-\delta definition, then the oscillation is at least \varepsilon_0, and conversely if for every \varepsilon there is a desired \delta, the oscillation is 0. The oscillation definition can be naturally generalized to maps from a topological space to a
metric space.
Definition using the hyperreals Cauchy defined the continuity of a function in the following intuitive terms: an
infinitesimal change in the independent variable corresponds to an infinitesimal change of the dependent variable (see ''Cours d'analyse'', page 34).
Non-standard analysis is a way of making this mathematically rigorous. The real line is augmented by adding infinite and infinitesimal numbers to form the
hyperreal numbers. In nonstandard analysis, continuity can be defined as follows. (see
microcontinuity). In other words, an infinitesimal increment of the independent variable always produces an infinitesimal change of the dependent variable, giving a modern expression to
Augustin-Louis Cauchy's definition of continuity.
Rules for continuity has no jumps or holes. The function is continuous. Proving the continuity of a function by a direct application of the definition is generally a noneasy task. Fortunately, in practice, most functions are built from simpler functions, and their continuity can be deduced immediately from the way they are defined, by applying the following rules: • Every
constant function is continuous • The
identity function is continuous •
Addition and multiplication: if the functions and are continuous on their respective domains and , then their sum and their product are continuous on the
intersection , where and are defined by and . •
Reciprocal: If the function is continuous on the domain , then its reciprocal , defined by {{tmath|1=(\tfrac 1 f)(x)= \tfrac 1{f(x)} }} is continuous on the domain {{tmath|1=D_f\setminus f^{-1}(0)}}, that is, the domain from which the points such that are removed. •
Function composition: If the functions and are continuous on their respective domains and , then the composition defined by is continuous on {{tmath|D_f\cap f^{-1}(D_g)}}, that the part of that is mapped by inside . • The
sine and cosine functions ( and ) are continuous everywhere. • The
exponential function is continuous everywhere. • The
natural logarithm is continuous on the domain formed by all positive real numbers {{tmath|\{x\mid x>0\} }}. . The function is not defined for x = -2. The vertical and horizontal lines are
asymptotes. These rules imply that every
polynomial function is continuous everywhere and that a
rational function is continuous everywhere where it is defined, if the numerator and the denominator have no common
zeros. More generally, the quotient of two continuous functions is continuous outside the zeros of the denominator. An example of a function for which the above rules are not sufficient is the
sinc function, which is defined by {{tmath|1=\operatorname{sinc}(0)=1 }} and {{tmath|1=\operatorname{sinc}(x)=\tfrac{\sin x}{x} }} for . The above rules show immediately that the function is continuous for , but, for proving the continuity at , one has to prove \lim_{x\to 0} \frac{\sin x}{x} = 1. As this is true, one gets that the sinc function is continuous function on all real numbers.
Examples of discontinuous functions ). An example of a discontinuous function is the
Heaviside step function H, defined by H(x) = \begin{cases} 1 & \text{ if } x \ge 0\\ 0 & \text{ if } x Pick for instance \varepsilon = 1/2. Then there is no around x = 0, i.e. no open interval (-\delta,\;\delta) with \delta > 0, that will force all the H(x) values to be within the of H(0), i.e. within (1/2,\;3/2). Intuitively, we can think of this type of discontinuity as a sudden
jump in function values. Similarly, the
signum or sign function \sgn(x) = \begin{cases} \;\;\ 1 & \text{ if }x > 0\\ \;\;\ 0 & \text{ if }x = 0\\ -1 & \text{ if }x is discontinuous at x = 0 but continuous everywhere else. Yet another example: the function f(x) = \begin{cases} \sin\left(x^{-2}\right)&\text{ if }x \neq 0\\ 0&\text{ if }x = 0 \end{cases} is continuous everywhere apart from x = 0. Besides plausible continuities and discontinuities like above, there are also functions with a behavior, often coined
pathological, for example,
Thomae's function, f(x)=\begin{cases} 1 &\text{ if } x=0\\ \frac{1}{q}&\text{ if } x = \frac{p}{q} \text{(in lowest terms) is a rational number}\\ 0&\text{ if }x\text{ is irrational}. \end{cases} is continuous at all irrational numbers and discontinuous at all rational numbers. In a similar vein,
Dirichlet's function, the
indicator function for the set of rational numbers, D(x)=\begin{cases} 0&\text{ if }x\text{ is irrational } (\in \R \setminus \Q)\\ 1&\text{ if }x\text{ is rational } (\in \Q) \end{cases} is nowhere continuous.
Properties A useful lemma Let f(x) be a function that is continuous at a point x_0, and y_0 be a value such f\left(x_0\right)\neq y_0. Then f(x)\neq y_0 throughout some neighbourhood of x_0.
Proof: By the definition of continuity, take \varepsilon =\frac{2}>0 , then there exists \delta>0 such that \left|f(x)-f(x_0)\right| Suppose there is a point in the neighbourhood |x-x_0| for which f(x)=y_0; then we have the contradiction \left|f(x_0)-y_0\right|
Intermediate value theorem The
intermediate value theorem is an
existence theorem, based on the real number property of
completeness, and states: :If the real-valued function
f is continuous on the
closed interval [a, b], and
k is some number between f(a) and f(b), then there is some number c \in [a, b], such that f(c) = k. For example, if a child grows from 1 m to 1.5 m between the ages of two and six years, then, at some time between two and six years of age, the child's height must have been 1.25 m. As a consequence, if
f is continuous on [a, b] and f(a) and f(b) differ in
sign, then, at some point c \in [a, b], f(c) must equal
zero.
Extreme value theorem The
extreme value theorem states that if a function
f is defined on a closed interval [a, b] (or any closed and bounded set) and is continuous there, then the function attains its maximum, i.e. there exists c \in [a, b] with f(c) \geq f(x) for all x \in [a, b]. The same is true of the minimum of
f. These statements are not, in general, true if the function is defined on an open interval (a, b) (or any set that is not both closed and bounded), as, for example, the continuous function f(x) = \frac{1}{x}, defined on the open interval (0,1), does not attain a maximum, being unbounded above.
Relation to differentiability and integrability Every
differentiable function f : (a, b) \to \R is continuous, as can be shown. The
converse does not hold: for example, the
absolute value function :f(x)=|x| = \begin{cases} \;\;\ x & \text{ if }x \geq 0\\ -x & \text{ if }x is everywhere continuous. However, it is not differentiable at x = 0 (but is so everywhere else).
Weierstrass's function is also everywhere continuous but nowhere differentiable. The
derivative f′(
x) of a differentiable function
f(
x) need not be continuous. If
f′(
x) is continuous,
f(
x) is said to be
continuously differentiable. The set of such functions is denoted C^1((a, b)). More generally, the set of functions f : \Omega \to \R (from an open interval (or
open subset of \R) \Omega to the reals) such that
f is n times differentiable and such that the n-th derivative of
f is continuous is denoted C^n(\Omega). See
differentiability class. In the field of computer graphics, properties related (but not identical) to C^0, C^1, C^2 are sometimes called G^0 (continuity of position), G^1 (continuity of tangency), and G^2 (continuity of curvature); see
Smoothness of curves and surfaces. Every continuous function f : [a, b] \to \R is
integrable (for example in the sense of the
Riemann integral). The converse does not hold, as the (integrable but discontinuous)
sign function shows.
Pointwise and uniform limits Given a
sequence f_1, f_2, \dotsc : I \to \R of functions such that the limit f(x) := \lim_{n \to \infty} f_n(x) exists for all x \in D,, the resulting function f(x) is referred to as the
pointwise limit of the sequence of functions \left(f_n\right)_{n \in N}. The pointwise limit function need not be continuous, even if all functions f_n are continuous, as the animation at the right shows. However,
f is continuous if all functions f_n are continuous and the sequence
converges uniformly, by the
uniform convergence theorem. This theorem can be used to show that the
exponential functions,
logarithms,
square root function, and
trigonometric functions are continuous.
Directional Continuity Image:Right-continuous.svg|A right-continuous function Image:Left-continuous.svg|A left-continuous function Discontinuous functions may be discontinuous in a restricted way, giving rise to the concept of directional continuity (or right and left continuous functions) and
semi-continuity. Roughly speaking, a function is if no jump occurs when the limit point is approached from the right. Formally,
f is said to be right-continuous at the point
c if the following holds: For any number \varepsilon > 0 however small, there exists some number \delta > 0 such that for all
x in the domain with c the value of f(x) satisfies |f(x) - f(c)| This is the same condition as continuous functions, except it is required to hold only for
x strictly larger than
c. Requiring |f(x) - f(c)| to hold instead for all
x with c - \delta yields the notion of functions. A function is continuous if and only if it is both right-continuous and left-continuous.
Semicontinuity A function
f is at the point
c if, roughly, any jumps that might occur only go down, but not up. That is, for any \varepsilon > 0, there exists some number \delta > 0 such that for all
x in the domain with |x - c| the value of f(x) satisfies f(x) \geq f(c) - \varepsilon. The reverse condition is . ==Continuous functions between metric spaces== The concept of continuous real-valued functions can be generalized to functions between
metric spaces. A metric space is a set X equipped with a function (called
metric) d_X, that can be thought of as a measurement of the distance of any two elements in
X. Formally, the metric is a function d_X : X \times X \to \R that satisfies a number of requirements, notably the
triangle inequality. Given two metric spaces \left(X, d_X\right) and \left(Y, d_Y\right) and a function f : X \to Y then f is continuous at the point c \in X (with respect to the given metrics) if for any positive real number \varepsilon > 0, there exists a positive real number \delta > 0 such that all x \in X satisfying d_X(x, c) will also satisfy d_Y(f(x), f(c)) As in the case of real functions above, this is equivalent to the condition that for every sequence \left(x_n\right) in X with limit \lim x_n = c, we have \lim f\left(x_n\right) = f(c). The latter condition can be weakened as follows: f is continuous at the point c if and only if for every convergent sequence \left(x_n\right) in X with limit c, the sequence \left(f\left(x_n\right)\right) is a
Cauchy sequence, and c is in the domain of f. The set of points at which a function between metric spaces is continuous is a
G_{\delta} set – this follows from the \varepsilon-\delta definition of continuity. This notion of continuity is applied, for example, in
functional analysis. A key statement in this area says that a
linear operator T : V \to W between
normed vector spaces V and W (which are
vector spaces equipped with a compatible
norm, denoted \|x\|) is continuous if and only if it is
bounded, that is, there is a constant K such that \|T(x)\| \leq K \|x\| for all x \in V.
Uniform, Hölder and Lipschitz continuity The concept of continuity for functions between metric spaces can be strengthened in various ways by limiting the way \delta depends on \varepsilon and
c in the definition above. Intuitively, a function
f as above is
uniformly continuous if the \delta does not depend on the point
c. More precisely, it is required that for every
real number \varepsilon > 0 there exists \delta > 0 such that for every c, b \in X with d_X(b, c) we have that d_Y(f(b), f(c)) Thus, any uniformly continuous function is continuous. The converse does not generally hold but holds when the domain space
X is
compact. Uniformly continuous maps can be defined in the more general situation of
uniform spaces. A function is
Hölder continuous with exponent α (a real number) if there is a constant
K such that for all b, c \in X, the inequality d_Y (f(b), f(c)) \leq K \cdot (d_X (b, c))^\alpha holds. Any Hölder continuous function is uniformly continuous. The particular case \alpha = 1 is referred to as
Lipschitz continuity. That is, a function is Lipschitz continuous if there is a constant
K such that the inequality d_Y (f(b), f(c)) \leq K \cdot d_X (b, c) holds for any b, c \in X. The Lipschitz condition occurs, for example, in the
Picard–Lindelöf theorem concerning the solutions of
ordinary differential equations. ==Continuous functions between topological spaces==