• No results found

Continuous functions Note: 2–2.5 lectures

Continuous Functions

3.2 Continuous functions Note: 2–2.5 lectures

You undoubtedly heard of continuous functions in your schooling. A high-school criterion for this concept is that a function is continuous if we can draw its graph without lifting the pen from the paper. While that intuitive concept may be useful in simple situations, we require rigor. The following definition took three great mathematicians (Bolzano, Cauchy, and finally Weierstrass) to get correctly and its final form dates only to the late 1800s.


Definition and basic properties

Definition 3.2.1. LetSR,cS, and let f: SRbe a function. We say that f iscontinuous at c if for everyε >0 there is aδ >0 such that wheneverx∈Sand|x−c|<δ, then|f(x)−f(c)|<ε.

When f: SRis continuous at allc∈S, then we simply say f is acontinuous function.

y= f(x) c f(c) ε ε δ δ

Figure 3.2:For|xc|<δ, the graph of f(x)should be within the gray region.

If f is continuous for allcA, we say f is continuous onAS. It is left as an easy exercise to show that this implies that f|Ais continuous, although the converse does not hold.

Continuity may be the most important definition to understand in analysis, and it is not an easy one. See . Note thatδ not only depends onε, but also onc; we need not pick oneδ for

allcS. It is no accident that the definition of continuity is similar to the definition of a limit of a function. The main feature of continuous functions is that these are precisely the functions that behave nicely with limits.

Proposition 3.2.2. Let SR, let f: SRbe a function, and let cS be a point. Then (i) If c is not a cluster point of S, then f is continuous at c.

(ii) If c is a cluster point of S, then f is continuous at c if and only if the limit of f(x)as x→c exists and


x→cf(x) = f(c).

(iii) f is continuous at c if and only if for every sequence{xn}where xn∈S andlimxn=c, the sequence{f(xn)}converges to f(c).

Proof. Let us start with the first item. Suppose cis not a cluster point ofS. Then there exists a

δ >0 such thatS∩(c−δ,c+δ) ={c}. Therefore, for anyε >0, simply pick this given delta. The

onlyxSsuch that|x−c|<δ isx=c. Then|f(x)−f(c)|=|f(c)−f(c)|=0<ε.

Let us move to the second item. Suppose cis a cluster point of S. Let us first suppose that limx→c f(x) = f(c). Then for everyε >0 there is aδ >0 such that ifx∈S\ {c}and|x−c|<δ,

then|f(x)−f(c)|<ε. Also|f(c)−f(c)|=0<ε, so the definition of continuity atcis satisfied.

On the other hand, suppose f is continuous atc. For everyε >0, there exists aδ >0 such that for

xSwhere|x−c|<δ we have |f(x)−f(c)|<ε. Then the statement is, of course, still true if

xS\ {c} ⊂S. Therefore, limx→cf(x) = f(c).

For the third item, first suppose f is continuous atc. Let{xn}be a sequence such thatxn∈S and limxn=c. Letε >0 be given. Find aδ >0 such that|f(x)−f(c)|<ε for allx∈Swhere

|x−c|<δ. Find anM∈Nsuch that forn≥Mwe have|xn−c|<δ. Then forn≥Mwe have that

|f(xn)−f(c)|<ε, so{f(xn)}converges to f(c).

Let us prove the other direction of the third item by contrapositive. Suppose f is not continuous atc. Then there exists anε>0 such that for allδ >0, there exists anx∈Ssuch that|x−c|<δ and

|f(x)−f(c)| ≥ε. Let us define a sequence{xn}as follows. Letxn∈Sbe such that|xn−c|<1/n

and |f(xn)−f(c)| ≥ε. Now {xn} is a sequence of numbers inS such that limxn=c and such that|f(xn)−f(c)| ≥ε for alln∈N. Thus{f(xn)}does not converge to f(c). It may or may not

converge, but it definitely does not converge to f(c).

The last item in the proposition is particularly powerful. It allows us to quickly apply what we know about limits of sequences to continuous functions and even to prove that certain functions are continuous. It can also be strengthened, see .

Example 3.2.3: f: (0,∞)Rdefined by f(x):=1/xis continuous.

Proof: Fixc(0,∞). Let{xn}be a sequence in(0,∞)such that limxn=c. Then we know that f(c) = 1 c = 1 limxn =nlim→∞ 1 xn =nlim→∞f(xn).

Thus f is continuous atc. As f is continuous at allc∈(0,∞), f is continuous.

We have previously shown limx→cx2=c2directly. Therefore the functionx2is continuous. We can use the continuity of algebraic operations with respect to limits of sequences, which we proved in the previous chapter, to prove a much more general result.

Proposition 3.2.4. Let f: RRbe apolynomial. That is

f(x) =adxd+ad−1xd−1+···+a1x+a0, for some constants a0,a1, . . . ,ad. Then f is continuous.

Proof. FixcR. Let{xn}be a sequence such that limxn=c. Then f(c) =adcd+ad−1cd−1+···+a1c+a0

=ad(limxn)d+ad−1(limxn)d−1+···+a1(limxn) +a0 = lim n→∞ adxdn+ad−1xnd−1+···+a1xn+a0 = lim n→∞f(xn). Thus f is continuous atc. As f is continuous at allc∈R, f is continuous.

By similar reasoning, or by appealing to , we can prove the following. The details of the proof are left as an exercise.

Proposition 3.2.5. Let f: SRand g: SRbe functions continuous at cS. (i) The function h: SRdefined by h(x):= f(x) +g(x)is continuous at c. (ii) The function h: S→Rdefined by h(x):= f(x)−g(x)is continuous at c.

(iii) The function h: S→Rdefined by h(x):= f(x)g(x)is continuous at c.

(iv) If g(x)6=0for all xS, the function h: SRdefined by h(x):= gf((xx)) is continuous at c.

Example 3.2.6: The functions sin(x)and cos(x)are continuous. In the following computations we use the sum-to-product trigonometric identities. We also use the simple facts that|sin(x)| ≤ |x|, |cos(x)| ≤1, and|sin(x)| ≤1.

|sin(x)−sin(c)|= 2sin x −c 2 cos x +c 2 =2 sin x −c 2 cos x +c 2 ≤2 sin x −c 2 ≤2 xc 2 =|x−c| |cos(x)−cos(c)|= − 2sin x −c 2 sin x +c 2 =2 sin x −c 2 sin x +c 2 ≤2 sin x −c 2 ≤2 xc 2 =|x−c|

The claim that sin and cos are continuous follows by taking an arbitrary sequence{xn}converg- ing toc, or by applying the definition of continuity directly. Details are left to the reader.


Composition of continuous functions

You probably already realized that one of the basic tools in constructing complicated functions out of simple ones is composition. Recall that for two functions f andg, the composition fgis defined by(f◦g)(x):= f g(x)

. A composition of continuous functions is again continuous. Proposition 3.2.7. Let A,BRand f: B→Rand g: A→B be functions. If g is continuous at

Proof. Let {xn}be a sequence in A such that limxn=c. Asg is continuous atc, then {g(xn)} converges tog(c). As f is continuous atg(c), then{f g(xn)}converges to f g(c). Thus f◦gis continuous atc.

Example 3.2.8: Claim: sin(1/x)2

is a continuous function on(0,∞).

Proof: First note that1/xis a continuous function on(0,)and sin(x)is a continuous function on(0,∞)(actually on all ofR, but(0,∞)is the range for 1/x). Hence the composition sin(1/x)is continuous. We also know thatx2is continuous on the interval(1,1)(the range of sin). Thus the composition sin(1/x)2

is also continuous on(0,∞).


Discontinuous functions

When f is not continuous atc, we say f isdiscontinuousatc, or that it has adiscontinuityatc. The following proposition is a useful test and follows immediately from third item of . Proposition 3.2.9. Let f: SRbe a function and cS. Suppose there exists a sequence{xn}, xn∈S, andlimxn=c such that{f(xn)}does not converge to f(c). Then f is discontinuous at c.

Again,{f(xn)}may or may not converge, but if it does, it definitely does not converge to f(c). Example 3.2.10: The function f: RRdefined by



−1 ifx<0,

1 ifx≥0, is not continuous at 0.

Proof: Take the sequence{−1/n}, which converges to 0. Then f(1/n) =1 for everyn, and so lim f(−1/n) =1, but f(0) =1. Thus the function is not continuous at 0. See .

1 5 1 4 1 3 1 2 1 ···

Figure 3.3:Graph of the jump discontinuity. The values of f(1/n)and f(0)are marked.

Notice that f(1/n) =1 for allnN. Hence, lim f(1/n) = f(0) =1. So{f(xn)}may converge to f(0)for some specific sequence{xn}going to 0, despite the function being discontinuous at 0.

Finally, consider f (−n1)n

= (−1)n. This sequence diverges.

Example 3.2.11: For an extreme example, take the so-calledDirichlet function . f(x):=


1 ifxis rational, 0 ifxis irrational.

The function f is discontinuous at allc∈R.

Proof: Supposecis rational. Take a sequence{xn}of irrational numbers such that limxn=c (why can we?). Then f(xn) =0 and so lim f(xn) =0, but f(c) =1. Ifcis irrational, take a sequence of rational numbers{xn}that converges toc(why can we?). Then lim f(xn) =1, but f(c) =0.

Let us test the limits of our intuition. Can there exist a function continuous at all irrational numbers, but discontinuous at all rational numbers? There are rational numbers arbitrarily close to any irrational number. Perhaps strangely, the answer is yes. The following example is called the Thomae function or thepopcorn function.

Example 3.2.12: Let f: (0,1)Rbe defined by f(x):=


1/k ifx=m/k, wherem,kNandmandkhave no common divisors, 0 ifxis irrational.

See the graph of f in . We claim that f is continuous at all irrationalcand discontinuous at all rationalc.

Figure 3.4:Graph of the “popcorn function.”

Proof: Suppose c=m/k is rational. Take a sequence of irrational numbers {xn} such that limxn=c. Then lim f(xn) =lim 0=0, but f(c) =1/k6=0. So f is discontinuous atc.

Now letcbe irrational, so f(c) =0. Take a sequence{xn}in(0,1)such that limxn=c. Given

ε>0, findK∈Nsuch that1/K<ε by the . Ifm/k∈(0,1)is in lowest terms

(no common divisors), thenm<k. So there are only finitely many rational numbers in(0,1)whose denominator k in lowest terms is less thanK. Hence there is anM such that for nM, all the numbersxnthat are rational have a denominator larger than or equal toK. Thus forn≥M,

|f(xn)−0|= f(xn)≤1/K<ε.

Therefore, f is continuous at irrationalc. Let us end on an easier example.

Example 3.2.13: Defineg: RRbyg(x):=0 ifx6=0 andg(0):=1. Thengis not continuous at zero, but continuous everywhere else (why?). The pointx=0 is called aremovable discontinuity. That is because if we would change the definition ofg, by insisting thatg(0)be 0, we would obtain

a continuous function. On the other hand let f be the function of example . Then f does not have a removable discontinuity at 0. No matter how we would define f(0)the function would still fail to be continuous. The difference is that limx→0g(x)exists while limx→0 f(x)does not.

Let us stay with this example but show another phenomenon. LetA={0}, theng|Ais continuous (why?), whilegis not continuous onA.



Exercise 3.2.1: Using the definition of continuity directly prove that f: R→Rdefined by f(x):=x2 is


Exercise3.2.2: Using the definition of continuity directly prove that f:(0,∞)Rdefined by f(x):=1/xis


Exercise3.2.3: Let f:R→Rbe defined by



x if x is rational, x2 if x is irrational.

Using the definition of continuity directly prove that f is continuous at1and discontinuous at2.

Exercise3.2.4: Let f:R→Rbe defined by



sin(1/x) if x6=0, 0 if x=0.

Is f continuous? Prove your assertion.

Exercise3.2.5: Let f:R→Rbe defined by



xsin(1/x) if x6=0, 0 if x=0.

Is f continuous? Prove your assertion.

Exercise3.2.6: Prove .

Exercise3.2.7: Prove the following statement. Let SRand A⊂S. Let f:S→Rbe a continuous function.

Then the restriction f|Ais continuous.

Exercise3.2.8: Suppose S⊂R. Suppose for some c∈Randα >0, we have A= (c−α,c+α)⊂S. Let f:S→Rbe a function. Prove that if f|Ais continuous at c, then f is continuous at c.

Exercise3.2.9: Give an example of functions f:R→Rand g:R→Rsuch that the function h defined by

h(x):= f(x) +g(x)is continuous, but f and g are not continuous. Can you find f and g that are nowhere

continuous, but h is a continuous function?

Exercise 3.2.10: Let f: R→Rand g: R→R be continuous functions. Suppose that for all rational

Exercise3.2.11: Let f:R→Rbe continuous. Suppose f(c)>0. Show that there exists anα>0such that for all x∈(cα,c+α)we have f(x)>0.

Exercise3.2.12: Let f:Z→Rbe a function. Show that f is continuous.

Exercise3.2.13: Let f:S→Rbe a function and c∈S, such that for every sequence{xn}in S withlimxn=c,

the sequence{f(xn)}converges. Show that f is continuous at c.

Exercise 3.2.14: Suppose f: [1,0] R and g: [0,1]→R are continuous and f(0) =g(0). Define

h:[−1,1]→Rby h(x):= f(x)if x≤0and h(x):=g(x)if x>0. Show that h is continuous.

Exercise3.2.15: Suppose g:R→Ris a continuous function such that g(0) =0, and suppose f:R→Ris

such that|f(x)f(y)| ≤g(xy)for all x and y. Show that f is continuous.

Exercise3.2.16(Challenging): Suppose f(x+y) = f(x)+f(y)for some f:R→Rsuch that f is continuous

at 0. Show that f(x) =ax for some a∈R. Hint: Show that f(nx) =n f(x), then show f is continuous onR.

Then show that f(x)/x= f(1)for all rational x.

Exercise3.2.17: Suppose SRand let f:S→Rand g:S→Rbe continuous functions. Define p:S→R

by p(x):=max{f(x),g(x)}and q:S→Rby q(x):=min{f(x),g(x)}. Prove that p and q are continuous. Exercise3.2.18: Suppose f: [1,1]Ris a function continuous at all x∈[−1,1]\ {0}. Show that for

everyε such that0<ε <1, there exists a function g:[−1,1]→Rcontinuous on all of[−1,1], such that

f(x) =g(x)for all x∈[−1,−ε]∪[ε,1], and|g(x)| ≤ |f(x)|for all x∈[−1,1].

Exercise3.2.19(Challenging): A function f:IRisconvexif whenever a≤x≤b for a,x,b in I, we have

f(x) f(a)bbxa+f(b)xbaa. In other words, if the line drawn between a,f(a)

and b,f(b)

is above the graph of f .

a) Prove that if I= (α,β)an open interval and f:I→Ris convex, then f is continuous.


Min-max and intermediate value theorems