You are on page 1of 11

Chapter 4

Continuity

Intuitively a continuous function f : R → R is one which has no ‘jumps’ in its graph, one for which
we can draw the graph without lifting pen from paper. For example, using this idea it is easy to
decide that f (x) = x2 and f (x) = |x| are continuous but that
(
0 x≤0
f (x) =
1 x>0

is not because of the jump in the graph at the origin. But it is much trickier to decide whether
(
sin(1/x) x 6= 0
f (x) =
0 x=0

is continuous or not — is there a jump at the origin in this graph?

We need a precise definition of continuity in order to be able to work with it mathematically. Here
it is.

39
Definition 4.1. A function f is continuous at a ∈ R if

f (an ) → f (a) as n → ∞ whenever an → a.

A function f : X → Y is continuous if f is continuous at each a ∈ X.

Examples 4.2. 1. f (x) = k, a constant, is continuous because f (an ) = k → k = f (a) as n → ∞


whenever an → a.

2. f (x) = x is continuous because f (an ) = an → a = f (a) as n → ∞ whenever an → a.

3. In contrast (
0 x≤0
f (x) =
1 x>0
is not continuous at 0 because 1/n → 0 but f (1/n) = 1 → 1 6= f (0).

4. And finally (
sin(1/x) x 6= 0
f (x) =
0 x=0
is not continuous at 0 because 2/nπ → 0 as n → ∞ but the sequence with terms f (2/nπ) =
sin(nπ/2) is 0, 1, 0, −1, 0, 1, 0, −1, . . . which diverges.

Not only is the above definition of continuity sufficient to settle this last tricky case, but it also
allows us to prove convenient results like the following.

Theorem 4.3 (Algebra of Continuity). Suppose f and g are continuous at a ∈ R. Then so is


any scalar multiple kf , where k ∈ R , the sum f + g , the product f g , and the quotient f /g ,
provided only that g(a) 6= 0 .

Proof. The proof follows from Theorem 3.12 since if an → a as n → ∞ then

(f + g)(an ) = f (an ) + g(an ) → f (a) + g(a) = (f + g)(a) as n → ∞,

where we use the continuity of f and of g, and the ‘Algebra of Limits’. The other parts are proved
similarly.

Corollary 4.4. Any polynomial function is continuous , and any rational function p/q (where p
and q are polynomials) is continuous except at those x ∈ R at which q(x) = 0.

Proof. This follows immediately from the last theorem and the fact that polynomials and rational
functions are defined to be those functions built from f (x) = 1 and f (x) = x by taking repeated
scalar multiples, sums products and, in the latter case, quotients.

40
Example 4.5. The function f (x) = x7 − 32x5 + 6x4 + 3x − 4 is continuous . The function
x6 + 42x2 − 8
g(x) =
x3 (x − 4)(x + 4)
is continuous except at x = 0, ±4. (It may be a relief that you do not need to sketch the graphs
to decide whether or not these are continuous!)

Lemma 4.6. Sine and cosine are continuous. Tangent is continuous where defined.

Proof. First we prove that sine and cosine are continuous at 0. From comparing areas in the
diagram below,
cos x sin x x x
≤ π = .
2 2π 2

1
1

sin x
x x
cos x 1

Moreover, cos x > 1/2 for |x| < π/3 so that combining with the above inequality and rearranging
gives | sin x| ≤ |2x|. Suppose an → 0 as n → ∞. Then | sin(an )| ≤ |2an | → 0 = sin(0) as n → ∞,
and so sine is continuous at 0.

Starting from the evident 0 ≤ cos x ≤ 1 for |x| < π/2 and multiplying by cos x yields cos2 x ≤
cos x ≤ 1. So
1 − sin2 (an ) = cos2 (an ) ≤ cos(an ) ≤ 1
and the left and right hand terms both tend to 1 as n → ∞. Therefore by the Sandwich Theorem
cos(an ) → 1 = cos(0) too. Hence cosine is continuous at 0.

Now we use the angle sum formulæ to deduce that sine and cosine are continuous at any a ∈ R.
Suppose an → a as n → ∞. Then an − a → 0 so

sin(an ) = sin ((an − a) + a) = sin(an − a) cos(a) + cos(an − a) sin(a)


→ 0 × cos(a) + 1 × sin(a) = sin(a)

as n → ∞ by the ‘algebra of limits’. Similarly

cos(an ) = cos ((an − a) + a) = cos(an − a) cos(a) − cos(an − a) cos(a)


→ 1 × cos(a) − 0 × sin(a) = cos(a)

as n → ∞. Thus sine and cosine are continuous.

Finally, it follows that tan = sin / cos is continuous except where cos = 0 , i.e. tan is continuous
wherever it is defined.

41
Proposition 4.7. The composite of continuous functions is continuous: more precisely if f is
continuous at a and g is continuous at f (a) then the composite g ◦ f is continuous at a .

Proof. Suppose an → a as n → ∞. Then f (an ) → f (a) as n → ∞ because f is continuous at a.


Therefore (g ◦ f )(an ) = g(f (an )) → g(f (a)) = (g ◦ f )(a) as n → ∞ because g is continuous at f (a).
This is eactly the statement that g ◦ f is continuous at a.

Examples 4.8. For example x 7→ sin(x3 − 3x + 2) is continuous , and


 
cos2 x−3
x+1
x2 − 4
is continuous for x 6= ±2, −1.

Remark 4.9. Another way to phrase the definition of continuity is that a function f is continuous
if and only if it commutes with limits, i.e. if and only if

lim f (an ) = f (a) = f ( lim an ).


n→∞ n→∞

for any sequence (an ) with limit limn→∞ an = a.

This can be useful in evaluating the limits of certain sequences. For example, because cosine is
continuous,    
n n
lim cos = cos lim = cos(1).
n→∞ n+1 n→∞ n + 1

4.1 The Intermediate Value Theorem


Our intuition is that a continuous function has no ‘jumps’ in its graph. So it should pass through
all intermediate values. The next result validates this intuition; it is the key link between the
definition of continuity and our intuitive notion, and is one of the most important results in the
module.

Theorem 4.10 (Intermediate Value Theorem). Suppose f : [a, b] → R is continuous and y ∈


(f (a), f (b)). (By this we mean either f (a) < y < f (b) or f (b) < y < f (a).) Then there is some
x ∈ (a, b) with f (x) = y.

Proof. For simplicity we assume f (a) < y < f (b) ; if f (b) < y < f (a) instead the proof is the same
with minor modifications. We construct sequences (an ) and (bn ) as follows:

Step 0 a0 = a and b0 = b.

42
Step 1 Consider the midpoint c0 = (a0 + b0 )/2 of the interval [a0 , b0 ] . Define
( (
c0 if f (c0 ) ≤ y b0 if f (c0 ) ≤ y
a1 = and b1 =
a0 otherwise, c0 otherwise.

Step 2 Repeat Step 1 starting with the interval [a1 , b1 ] in place of [a0 , b0 ] .

We continue in this way, repeating Step 1 with the interval found at the previous stage, to define
the sequences (an ) and (bn ). We note the following facts:

(a) a = a0 ≤ a1 ≤ · · · ≤ b1 ≤ b0 = b because the midpoint of an interval always lies between the


two endpoints;

(b) bn − an = (bn−1 − an−1 )/2 = · · · = (b − a)/2n because one endpoint is always replaced by the
midpoint at each step, so that the length of the interval halves ;

(c) f (an ) ≤ y ≤ f (bn ) for any n ∈ N because of the rule for choosing the new interval in Step 1
.

(See Figure 4.1 for an illustration.) From (a) it follows that (an ) is increasing and bounded above
by b , and hence an → x as n → ∞ for some limit x ≤ b , and that (bn ) is decreasing and
bounded below by a , and hence bn → x0 as n → ∞ for some limit x0 ≥ a . Moreover, from (b)
and the Algebra of Limits,
b−a 1
x − x0 = lim (bn − an ) = lim n
= (b − a) lim n = 0,
n→∞ n→∞ 2 n→∞ 2

so that x = x0 ∈ [a, b] . Since f is continuous, f (an ) → f (x) and f (bn ) → f (x0 ) = f (x) as n → ∞.
Therefore, by (c) and the Sandwich Theorem, y = f (x) as required.

Examples 4.11. (a) f (x) = x3 + 5x − 4 is continuous and f (0) = −4 and f (1) = 2. Therefore by
the Intermediate Value Theorem f (x) = 0 for some x ∈ (0, 1), i.e. f has a root in (0, 1) . The
method of the proof shows how to approximate this root (to any desired accuracy) using the
method of bisection:

f (1/2) < 0 ⇒ there is a root in (1/2, 1)


f (3/4) > 0 ⇒ there is a root in (1/2, 3/4)

and so on. From the above we already know that there is a root within 1/8 of the midpoint
5/8 of [1/2, 3/4] .

(b) Has f (x) = x−cos x a root for some in (0, π/2)? Yes, since it is continuous and f (0) = −1 < 0
and f (π/2) = π/2 > 0 with the Intermediate Value Theorem implies there is f (x) = 0 for
some x ∈ (0, π/2).

43
f (b)

f (a)

a0 a1 a2 x b0 = b1 = b2

Figure 4.1: The above diagram illustrates the proof of the Intermediate Value Theorem and the
method of bisection: the shaded regions depict the first two steps in bisecting the interval [a0 , b0 ]
to approximate a solution of f (x) = y for the given y.

(c) For f (x) = 1/x we see that f (−1) < 0 and f (1) > 0 but there is no root in the interval
(−1, 1). f is not continuous (or even defined) at 0, and we cannot apply the Intermediate
Value Theorem.

Theorem 4.12 (Min/Max Theorem). Suppose f : [a, b] → R is continuous . Then there are
xmin , xmax ∈ [a, b] such that f (xmin ) ≤ f (x) ≤ f (xmax ) for all x ∈ [a, b] . (In other words f takes
its minimum value at xmin and its maximum value at xmax . Of course, xmin and xmax need not be
unique, there may be many points at which f has a minimum or a maximum.)

Proof. We prove the result by contradiction. Suppose that f (x) is not bounded above on [a, b] .
Then we can choose a sequence of points xn ∈ [a, b] such that f (xn ) ≥ n , in particular f (xn ) → ∞.
By the Bolzano Weierstrass Theorem (xn ) has a convergent subsequence, (yn ) say with yn → y
as n → ∞. By construction f (yn ) → ∞ as n → ∞, but since f is continuous f (yn ) → f (y) as
n → ∞. This is a contradiction, so our assumption that f was not bounded above must have been
false. A similar argument shows that f is bounded below.

It remains to show that f achieves its bounds, i.e. that xmin and xmax exist. The argument is similar
to the first part. Let U = sup{f (x) : x ∈ [a, b]}. Then we may choose a sequence un in [a, b] with
f (un ) → U as n → ∞. By the Bolzano Weierstrass Theorem (un ) has a convergent subsequence
(vn ), and then f (vn ) → U as n → ∞ too. But (vn ) is convergent so vn → v for some v as n → ∞.

44
Since f is continuous this means that f (vn ) → f (v) as n → ∞. Therefore U = f (v), and so we
set v = xmax . Making a similar argument starting with a greatest lower bound shows that xmin
exists.

Examples 4.13. a) The function sin : [0, π] → R is continuous. It achieves a minimum value of 0 at
0 (and at π) and a maximum value of 1 at π/2.

b) The function f : (0, ∞) → R : x 7→ 1/x is continuous, but it does not achieve a minimum or
maximum as it’s domain does not include the endpoint.

Warning 4.14. If the function f is not continuous then it need not achieve a minimum or maximum
value. For instance consider (
1/x x 6= 0
f (x) =
0 x=0
on the interval [−1, 1]. It is neither bounded below nor above, taking all values in (−∞, −1] ∪ {0} ∪
[1, ∞).

For our final result about continuous functions, which gives conditions for a continuous function
to have a continuous inverse and, in particular, guarantees that there are such functions as arcsin,

arccos, arctan, and more generally x1/n for any n ≥ 2, we require the following notions.

Definition 4.15. A function f is

(a) increasing if x ≤ x0 ⇒ f (x) ≤ f (x0 ),

(b) strictly increasing if x < x0 ⇒ f (x) < f (x0 ),

(c) decreasing if x ≤ x0 ⇒ f (x) ≥ f (x0 ),

(d) strictly decreasing if x < x0 ⇒ f (x) > f (x0 ).

For example f (x) = x is strictly increasing , f (x) = bxc is increasing (here bxc is the greatest
integer ≤ x), a constant function — e.g. f (x) = 3 — is both increasing and decreasing , and
f (x) = −x3 is strictly decreasing.

Theorem 4.16. If f is strictly increasing and continuous then it has an inverse f −1 which is also
strictly increasing and continuous. The same holds with decreasing in place of increasing.

Proof. The proofs for increasing and decreasing functions are very similar, so we only treat the
former.

The first job is to see that the inverse exists. Since f is strictly increasing it takes its minimum and

45
maximum values respectively at the beginning and end of the interval [a, b]. Moreover, since it
is continuous the Intermediate Value Theorem shows that for any y ∈ [f (a), f (b)] there is some
x ∈ [a, b] with y = f (x). In fact there is a unique such x because f is strictly increasing . This
shows that the inverse f −1 exists.

It is clear from the graph, which is the reflection of the graph of f in the line y = x, that f −1 is
strictly increasing and continuous. More formally: let y < y 0 and suppose that f −1 (y) ≥ f −1 (y 0 )
. Then, using the fact that f is increasing, y = f (f −1 (y)) ≥ f (f −1 (y 0 )) = y 0 which contradicts the
fact that y < y 0 . Hence we must have f −1 (y) < f −1 (y 0 ) , i.e. f −1 is strictly increasing.

It remains to show that f −1 is continuous. Suppose yn → y as n → ∞. Let Ln ≤ yn ≤ Un be


the increasing and decreasing sequences of lower and upper bounds for the tails of (yn ). Recall
from Remark 3.20 that Ln , Un → y as n → ∞ too . Since f −1 is strictly increasing, (f −1 (Ln )) is
an increasing sequence , and is bounded above by b . Hence f −1 (Ln ) → x, say, as n → ∞ .
Then because f is continuous Ln = f (f −1 (Ln )) → f (x) as n → ∞. But we know that Ln → y as
n → ∞, so we conclude that y = f (x) or equivalently f −1 (y) = x . A similar argument shows
that f −1 (Un ) → f −1 (y) as well. Therefore, since

f −1 (Ln ) ≤ f −1 (yn ) ≤ f −1 (Un )

the Sandwich Theorem tells us that f −1 (yn ) → y. This shows that f −1 is continuous.

Examples 4.17. (a) f (x) = x2 is continuous and strictly increasing as a function [0, ∞) → [0, ∞),

hence it has a strictly increasing, continuous inverse f −1 (x) = x. Similarly, x 7→ x1/n is
strictly increasing and continuous on [0, ∞) for any n ≥ 1 .

(b) sin : [−π/2, π/2] → [−1, 1] is strictly increasing and continuous, hence has a strictly increasing,
continuous inverse sin−1 = arcsin : [−1, 1] → [−π/2, π/2].

(c) cos : [0, π] → [−1, 1] is strictly decreasing and continuous, hence has a strictly decreasing,
continuous inverse cos−1 = arccos : [−1, 1] → [0, π].

4.2 Limits of functions


If f is continuous at a then the values f (x) for x near to a determine the value f (a). In particular,
there is only one choice for f (a) which makes the function continuous. To give a concrete example,
if f (x) = x2 for x 6= 2 then we must choose f (2) = 4 in order to make f continuous. We say that
4 is the limiting value of f at x = 2. More generally,

Definition 4.18. A function f has limit L at a ∈ R if

f (an ) → L as n → ∞ whenever an → a with an 6= a.

We write limx→a f (x) = L or f (x) → L as x → a.

46
Comparing with the definition of continuity we see that the limit (when it exists) is the unique
value which makes the function continuous at a. In particular, if f is already continuous at a then
limx→a f (x) = f (a). For example
lim (x2 + 3x − 2) = 2.
x→1
However, f need not be continuous or even defined at a for the limit to exist: for example
f : (−∞, 0) ∪ (0, ∞) → R : x 7→ 1 has limx→0 f (x) = 1.

A more interesting example is the function f (x) = x sin(1/x) which is defined for x 6= 0. Note that
if an → 0 as n → ∞ (with an 6= 0 for any n) then
 
1
|f (an )| = an sin
≤ |an | → 0
an
as n → ∞ because | sin x| ≤ 1 for any x ∈ R. Hence limx→0 x sin(1/x) = 0. Put another way, the
function (
x sin(1/x) x 6= 0
x 7→
0 x=0
is continuous.

Finally, note that the limit may not exist: the function defined by f (x) = −1 when x < 0 and
f (x) = 1 when x > 0 has no limit at 0 because applying f to the sequence (1, −1/2, 1/3, −1/4, . . .),
which converges to 0, we obtain the sequence (1, −1, 1, −1, . . .) which does not converge. It is clear
from the graph in this case that there is no value of f (0) which will make the function continuous.

In this last example, there is a limit from the left, namely −1, and a limit from the right, namely
1. More formally,

Definition 4.19. A function f has left limit L at a ∈ R if

f (an ) → L as n → ∞ whenever an → a with an < a.

We write limx%a f (x) = L or f (x) → L as x % a. Analogously, a function f has right limit L at


a ∈ R if
f (an ) → L as n → ∞ whenever an → a with an > a.
We write limx&a f (x) = L or f (x) → L as x & a.

All of our tools for computing limits of sequences transfer easily to computing limits of functions. We
omit the proofs of the following results as they follow easily from their counterparts for sequences.

Theorem 4.20 (Algebra of Limits II). Suppose f (x) → L and g(x) → M as x → a. Then
kf (x) → kL for any k ∈ R, the sum f (x) + g(x) → L + M , the product f (x)g(x) → LM , and the
quotient f (x)/g(x) → L/M provided only that M 6= 0 in the last case.

Theorem 4.21 (Sandwich Theorem II). Suppose f (x) ≤ g(x) ≤ h(x) for x near a and that
f (x), h(x) → L as x → a. Then g(x) → L as x → a too.

47
As an example of their application:

Lemma 4.22.
sin x cos x − 1
lim =1 and lim = 0.
x→0 x x→0 x

Proof. By considering the areas of the shapes in the diagram below we obtain inequalities:
x 1 x
π cos2 x ≤ sin x cos x ≤ π.

sx 2 2π

1
co

x x x

Simplifying, and multiplying through by 2/(x cos x), yields

sin x 1
cos x ≤ ≤ .
x cos x
Since cos is continuous we have cos x → cos 0 = 1 as x → 0. So, using the Sandwich Theorem II,
we obtain sin x/x → 1 as x → 0.

For the second part we compute using the Algebra of Limits II:
cos x − 1 cos x − 1 cos x + 1
lim = lim
x→0 x x→0 x cos x + 1
2
cos x − 1
= lim
x→0 x(cos x + 1)

− sin2 x
= lim
x→0 x(cos x + 1)
sin x sin x
= lim −
x→0 x cos x + 1
0
= −1 × = 0.
2

We can also define infinite limits, and limits at infinity, i.e. as x → ±∞. Rather than give the
formal definitions we explain by example.

Example 4.23. Let f (x) = (2x − 1)/(x − 1). Then limx%−1 f (x) = ∞ because 2x − 1 → −3 and
x + 1 % 0 as x % −1. Similarly limx&−1 f (x) = −∞ because 2x − 1 → −3 and x + 1 & 0 as
x & −1. Moreover,
2x − 1 3
f (x) = =2− →2
x−1 x−1

48
as x → ±∞ because 3/(x − 1) → 0 as x → ±∞. The graph clarifies the meaning of these
calculations:

49

You might also like