14  Continuity

Highlights of this Chapter: we formalize the concept of continuity, one of the foundational definitions in the analysis of functions. We provide an equivalent definition built out of sequences, and use it to prove ‘continuity analogs’ of the limit theorems. Finally, we prove that continuous functions are determined by their values on a dense set, an oft-useful result allowing one to reduce various arguments to considerations about rational numbers.

What does continuity mean? In pre-calculus classes, we often first hear something like “you can draw the graph without picking up your pencil”. This is a good guide to start with for a formal definition: its clearly capturing some property that is easy to check by visual inspection! But it’s not precise: terms like “you” and “pencil”, as well as modal phrases like “can draw” are nowhere to be found in the axioms of ordered fields! How can we say the same thing, using words we have access to?

First, a function is an input-output machine, so we should rephrase things in terms of inputs and outputs. When a graph makes a jump (where you’d have to pick up your pencil), the output changes a lot even when the input barely does. Thus, not having to pick up your pencil means you change the input by a little bit, the output changes by a little bit.

This is totally something we can make precise! A good start is by giving names to things: we want to say for any change in the input smaller than some δ, we know the output cant change that much: maybe its maximum is some other small change ϵ:

Definition 14.1 (ϵ-δ continuity) A function f is continuous at a point a in its domain if for every ϵ>0 there is some threshold δ where if x is within δ of a, then f(x) is within ϵ of f(a). As a logic sentence: ϵ>0δ>0x|xa|<δ|f(x)f(a)|<ϵ

A function is continuous on a set XR if it is continuous at a for each aR. A function is continuous if it is continuous on its domain.

14.1 Using the ϵδ Definition

This definition looks a lot like the sequence definition, at least in terms of the order of the quantifiers. And this is a good thing for us, who are now experts at the sequence definition!

Example 14.1 Any constant function f(x)=c is continuous at every real number a.

Example 14.2 The function y=x is continuous at every real number a.

This generalizes directly to functions like f(x)=2x+1, where now for a fixed ϵ we may wish to take δ=ϵ/2 after some scratch work:

Exercise 14.1 Show that linear functions y=mx+b are continuous at every aR.

Exercise 14.2 Prove that the function f(x)=|x| is continuous at x=0. Then use the fact that f(x)=x for x>0 and f(x)=x for x<0 (which are linear functions) to conclude that |x| is continuous at every real number.

Like any definition, its good after seeing a few examples to also turn and look at non-examples:

Example 14.3 The step function h(x)={0x01x>0 is discontinuous at 0, but is continuous at all other real numbers.

Thus, a function with a jump in it is discontinuous right at the jump, as we expect. This shows its possible for a function to be discontinuous at a single point, but things can get much stranger!

Example 14.4 The characteristic function of the rational numbers is discontinuous everywhere. b(x)={1xQ0xQ

We saw above a function that is discontinuous at a single point, and then one that is discontinuous everywhere. What’s harder to imagine, is a function that is continuous at a single point. Try thinking about what this might mean!

Exercise 14.3 Show that the following function is continuous at 0 and discontinuous everywhere else:

g(x)={xxQ0xQ

While the ϵδ definition is nice in that it looks like the sequence definition, we still end up having to play the ϵ game with every argument. Indeed, while some functions are well-suited these, for other relatively simple looking arguments, picking the right δ actually turns out to be a bit of work!

Exercise 14.4 Prove that f(x)=x2 is a continuous function using the ϵδ definition.

To avoid having to do such hard work on a regular basis, we will seek to broaden our theoretical toolkit.

14.2 Continuity With Sequences

We spent a lot of time working with sequences so far, so it would be nice if we could leverage some of that knowledge as more than just analogy. And indeed we can! In this section, we introduce an alternative definition of continuity, and prove that it is equivalent to our original.

Definition 14.2 (Continuity) Let f be a real valued function with domain DR and aD a point. Then f is continuous at a if for every convergent sequence {xn}D with xna, the limit can be taken either before or after applying f: limf(xn)=f(limxn)=f(a) A function is continuous on a set SD if it is continuous at each point of S.

Thus, we can think of continuity as the condition that allows us to “pull the limit inside of f”. It is immediate from the definition that constant functions are continuous at every point of their domain, as is the function f(x)=x.

Example 14.5 The function f(x)=x2 is continuous on the entire real line.

Proof. Let aR be arbitrary, and let xn be an arbitrary sequence converging to a. Then by the limit theorem for products, we see that since xna, it follows that xn2a2. Thus, if f(x)=x2 we have limf(xn)=limxn2=a2=f(a)=f(limxn) So, f is continuous at x=a. Since a was an arbitrary real number, f is continuous on the entire real line.

Theorem 14.1 (Equivalence of Continuity Definitions) Let f be a real function, and a a point of its domain. Then f is continuous by the sequence definition if and only if it is continuous by the ϵ-δ definition.

This theorem is an equivalence of definitions or an if-and-only-if result, so the proof requires two parts: first we show that continuity implies sequence continuity, and then we show the converse.

Proof (Continuity Implies Sequence Continuity). Let f be continuous at a, and xn an arbitrary sequence converging to a. We wish to show the sequence f(xn) converges to f(a). Choosing an ϵ>0, we use the assumed continuity to get a δ>0 where |xa|<δ implies that |f(x)f(a)|<ϵ.

But since xna, we know there must be some N such that for n>N we have |xna|<δ: thus for this same N we have |f(xn)f(a)|<ϵ.

Putting this all together, this is just the definition of convergence for the sequence f(xn) to f(a): starting with ϵ>0 we got an N which for n>N we can guarantee |f(xn)f(a)|<ϵ. So we are done.

Proof (Sequence Continuity Implies Continuity). Here we prove the contrapositive: that if f is not continuous at a then it is also not sequence continuous there.

If f is not continuous at a then there is some ϵ where for every δ>0 we can find points within δ of a where f(x) is more than ϵ away from f(a). From this we need to somehow produce a sequence, so we will take a sequence of such δ’s and for each pick some such bad point x.

For example, if we let δ=1/n then call xn the point with |xna|<1/n but |f(xn)f(a)|>ϵ. Doing this for all n produces a sequence where a1n<xn<a+1n And so by the squeeze theorem we see that xn converges, and its limit is a. But we also know (by our choices of xn) that for every element of this sequence |f(x_n)-f(a)|>$, so there’s no way that f(xn) converges to f(a).

Thus, we’ve shown by example that our function is not sequence continuous at a, as required.

When working with this definition of continuity, its important to remember that we need to check f(limx)=limf(xn) for all sequences xna. If it fails for any individual sequence, that is enough to show the function is not continuous at that point. Thus when proving continuity we will always start with let xn be an arbitrary sequence converging to a, and make use of convergence theorems to help us (since we cannot know the particular sequence), whereas for proving discontinuity all we need to do is produce a specific example sequence that fails.

Exercise 14.5 The function sgn(x)={1x<00x=01x>0 is discontinuous at x=0, but continuous at every other real number.

Its useful to have two definitions, as often one will be easier to use than the other. Below we will see many examples where sequence continuity is easier to apply, but here’s an example where ϵδ continuity makes things clearer.

Proposition 14.1 Let f be a continuous function, and assume that f(c)0 for some point cR. Then there exists a small interval (cδ,c+δ) on which f(x)0 for all x in the interval.

Proof. Let ϵ=|f(c)|/2. Then by continuity, there is some δ such that if |xc|<δ we know |f(x)f(c)|<ϵ. Unpacking this, for all x(cδ,c+δ) we know

ϵ=|f(c)|2<f(x)f(c)<|f(c)|2=ϵ

And thus

f(c)|f(c)|2<f(x)<f(c)+|f(c)|2

If f(c) is positive, then the lower bound here is f(c)/2 which is still positive, so f(x) is always positive in the interval. And, if f(c) is negative, the upper bound here is f(c)/2 which is still negative: thus f(x) is always negative in the interval.

14.3 Analogs of the Limit Theorems

Beause we have an equivalent characterization of continuity in terms of sequence convergence, and we have many theorems about this, we can use our characterization to rephrase these as results about continuity.

Proposition 14.2 (Continuity of Multiples) If f is continuous at aR and kR is a constant, then the function kf:xkf(x) is continuous at a.

Proof. Let aR be arbitrary, and xn a sequence converging to a. Then by the limit theorem for multiples, kxnka. Rephrasing this in terms of the function f(x)=kx, this just says that limf(xn)=f(limxn) so f is continuous at a.

Theorem 14.2 (Continuity of Field Operations) Let f,g be functions which are continuous at a point a. Then the functions f(x)+g(x),f(x)g(x) and f(x)g(x) are all continuous at a. Furthermore if g(a)0 then f(x)/g(x) is also continuous at a.

Proof. Let f,g be any two continuous functions and let aR be a point in their domains. Let xn be any sequence converging to a. Since f is continuous we know that limf(xn)=f(limxn)=f(a) and similarly by the continuity of g, limg(xn)=f(limxn)=g(a). Thus by the limit theorem for sums, the sequence f(xn)+g(xn) is convergent, with lim(f(xn)+g(xn))=limf(xn)+limg(xn)=f(a)+g(a) So, f+g is continuous at a. Since a was arbitrary, we see that f+g is continuous at every point of its domain. The same argument applies for subtraction, multiplication, and division using the respective limit theorems for sequences.

One of the most important operations for functions is that of composition: if f:RR and g:RR then the function gf:RR is defined as gf(x):=g(f(x)). More generally, so long as the domain of g is a subset of the range of f, the composition gf is well defined.

Theorem 14.3 (Continuity of Compositions) Let f,g be functions such that f is continuous at a, and g is continuous at f(a). Then the composition gf(x):=g(f(x)) is continuous at a.

Proof. Let xn be an arbitrary sequence converging to aR: we wish to show that limg(f(xn))=g(f(limxn))=g(f(a)). Since f is continuous at x=a we see immediately that f(xn) is a convergent sequence with f(xn)f(a). And now, since g is assumed to be continuous at x=f(a) and f(xn) is a sequence converging to this point, we know g(f(xn))=g(f(a)) as required.

Exercise 14.6 Let f(x) be a continuous function, and assume that f(x)2 is a constant function. Prove that f(x) is constant.

Give an example of an f(x) where f(x)2 is constant, but f is not.

Theorem 14.4 (Continuity of Roots) The function R(x)=x is continuous on [0,).

Proof. Actually we already proved this, before we had the terminology! Re-read ?exr-limit-of-root: it shows that if xna is a convergent sequence with xn0 and a0, then xna. So limxn=limxn, and x is continuous at the arbitrary nonnegative real a.

The same is true for nth roots, though we do not stop to prove it here, you may wish to for practice!

14.4 Useful Examples

Because continuity is going to be a big part of our course, its good to have a couple examples of functions we already know to be continuous. The ones below are particularly useful:

Exercise 14.7 (Continuity of Polynomials) Prove that every polynomial is a continuous function on the entire real line. Hint: induction on the degree of the polynomial!

Exercise 14.8 (Continuity of Rational Functions) A rational function is a quotient of polynomials r(x)=p(x)/q(x). Prove that every rational function is continuous, on every point of its domain.

Exercise 14.9 If f is continuous at a point a, then |f| is continuous there.

Hint: either use the reverse triangle inequality (?exr-reverse-triangle-inequality) or use that its a composition

Exercise 14.10 (Continuity of Max and Min) Prove that for any two numbers x,y we can express the max and min by the following formulas: FORMULAS

Use this, together with the limit theorems on field operations and continuity to prove that for any two continuous functions f(x),g(x) that the functions max{f(x),g(x)} and min{f(x),g(x)} are continuous.

Putting all this together, we already can build many examples of continuous functions! For example,

|3x2+2x1|7max{7x,2x2+3}4(3x2+11)

Exercise 14.11 Prove carefully that the above function is continuous at every aR, using the theorems and examples developed above.

14.5 Continuity and the Rationals

Before closing the introductory chapter on continuity, we turn to one important theoretical tool: the density of the rationals. Because every real number is the limit of a sequence of rationals, and continuous functions are determined by limits, it seems that continuous functions are rather constrained by their value on the rationals. This is indeed true, and will prove quite useful: we prove it in two steps below.

Proposition 14.3 If f is a continuous function such that f(r)=0 for every rational number r, then f=0 is the zero function.

Proof. Let f be such a function, and aR any real number. Then there is a sequence rn of rational numbers converging to a. Given that f is zero on all rationals, we see that f(rn)=0 for all n. Thus f(rn) is the constant zero sequence, and so its limit is zero: limf(rn)=lim0=0 But, since f is assumed to be continuous, we know that we can move the limit inside of f: 0=limf(rn)=f(limrn)=f(a) Thus f(a)=0, and since a was arbitrary, we see f is the constant function equal to zero at all real numbers.

Corollary 14.1 Let f,g be continuous functions such that for all rQ they are equal: f(r)=g(r). Then in fact, f=g: for all xR, f(x)=g(x)

Proof. Since f and g are continuous, the function h=fg is continuous using the theorems for field operations. And, since f(x)=g(x) for all rational x, we see h(x)=0 on the rationals. Thus, by , h itself must be the zero function on all of R. Thus for every x, h(x)=f(x)g(x)=0, or rearranging, x,f(x)=g(x)

This has a the pretty significant consequence that if we have a function and we know it is continuous, then being able to calculate its values at the rational numbers is good enough to completely determine the function on the real line. In particular, this can be used to prove various uniqueness results: you can show a certain function is uniquely defined if you can prove that its definition implies (1) continuity and (2) determines the rational points (or more generally, the values on a dense set).

Exercise 14.12 Let XR be any dense subset. Prove that if f is a continuous function then it is completely determined by its values on X by showing

  • Every real number is the limit of some sequence xn of points in X.
  • If f is continuous f(x)=0 on all points of x, then f is the zero function.
  • If f,g are two continuous functions with f(x)=g(x) for xX, then they are the same function.

We will use this property in understanding exponential functions (where their value at rational numbers are determined by powers and roots) and trigonometric functions (whose values on certain dyadic multiples of π are determined by the half-angle identities.)