4Continuous functions
IA Analysis I
4.1 Continuous functions
Definition (Continuous function). Let
A ⊆ R
,
a ∈ A
, and
f
:
A → R
. Then
f
is continuous at
a
if for any
ε >
0, there is some
δ >
0 such that if
y ∈ A
is such
that |y − a| < δ, then |f(y) − f(a)| < ε. In symbols, we have
(∀ε > 0)(∃δ > 0)(∀y ∈ A) |y −a| < δ ⇒ |f (y) − f(a)| < ε.
f is continuous if it is continuous at every a ∈ A. In symbols, we have
(∀a ∈ A)(∀ε > 0)(∃δ > 0)(∀y ∈ A) |y −a| < δ ⇒ |f (y) − f(a)| < ε.
Intuitively,
f
is continuous at
a
if we can obtain
f
(
a
) as accurately as we
wish by using more accurate values of
a
(the definition says that if we want to
approximate
f
(
a
) by
f
(
y
) to within accuracy
ε
, we just have to get our
y
to
within δ of a for some δ).
For example, suppose we have the function
f(x) =
(
0 x ≤ π
1 x > π
.
Suppose that we don’t know what the function actually is, but we have a
computer program that computes this function. We want to know what
f
(
π
)
is. Since we cannot input
π
(it has infinitely many digits), we can try 3, and it
gives 0. Then we try 3
.
14, and it gives 0 again. If we try 3
.
1416, it gives 1 (since
π
= 3
.
1415926
··· <
3
.
1416). We keep giving more and more digits of
π
, but the
result keeps oscillating between 0 and 1. We have no hope of what
f
(
π
) might
be, even approximately. So this f is discontinuous at π.
However, if we have the function
g
(
x
) =
x
2
, then we can find the (approx-
imate) value of
g
(
π
). We can first try
g
(3) and obtain 9. Then we can try
g
(3
.
14) = 9
.
8596,
g
(3
.
1416) = 9
.
86965056 etc. We can keep trying and obtain
more and more accurate values of g(π). So g is continuous at π.
Example.
– Constant functions are continuous.
– The function f(x) = x is continuous (take δ = ε).
The definition of continuity of a function looks rather like the definition of
convergence. In fact, they are related by the following lemma:
Lemma. The following two statements are equivalent for a function
f
:
A → R
.
– f is continuous
– If (a
n
) is a sequence in A with a
n
→ a, then f(a
n
) → f(a).
Proof. (i)⇒(ii) Let ε > 0. Since f is continuous at a,
(∃δ > 0)(∀y ∈ A) |y −a| < δ ⇒ |f (y) − f(a)| < ε.
We want
N
such that
∀n ≥ N
,
|f
(
a
n
)
− f
(
a
)
| < ε
. By continuity, it is enough
to find N such that ∀n ≥ N , |a
n
− a| < δ. Since a
n
→ a, such an N exists.
(ii)
⇒
(i) We prove the contrapositive: Suppose
f
is not continuous at
a
. Then
(∃ε > 0)(∀δ > 0)(∃y ∈ A) |y −a| < δ and |f(y) −f(a)| ≥ ε.
For each
n
, we can therefore pick
a
n
∈ A
such that
|a
n
− a| <
1
n
and
|f
(
a
n
)
−
f
(
a
)
| ≥ ε
. But then
a
n
→ a
(by Archimedean property), but
f
(
a
n
)
6→ f
(
a
).
Example.
(i)
Let
f
(
x
) =
(
−1 x < 0
1 x ≥ 0
. Then
f
is not continuous because
−
1
n
→
0 but
f(−
1
n
) → −1 6= f(0).
(ii) Let f : Q → R with
f(x) =
(
1 x
2
> 2
0 x
2
< 2
Then
f
is continuous. For every
a ∈ Q
, we can find an interval about
a
on
which f is constant. So f is continuous at a.
(iii) Let
f(x) =
(
sin
1
x
x 6= 0
0 x = 0
Then
f
(
a
) is discontinuous. For example, let
a
n
= 1
/
[(2
n
+ 0
.
5)
π
]. Then
a
n
→ 0 and f(a
n
) → 1 6= f(0).
We can use this sequence definition as the definition for continuous functions.
This has the advantage of being cleaner to write and easier to work with. In
particular, we can reuse a lot of our sequence theorems to prove the analogous
results for continuous functions.
Lemma. Let A ⊆ R and f, g : A → R be continuous functions. Then
(i) f + g is continuous
(ii) fg is continuous
(iii) if g never vanishes, then f /g is continuous.
Proof.
(i) Let a ∈ A and let (a
n
) be a sequence in A with a
n
→ a. Then
(f + g)(a
n
) = f(a
n
) + g(a
n
).
But f (a
n
) → f(a) and g(a
n
) → g(a). So
f(a
n
) + g(a
n
) → f(a) + g(a) = (f + g)(a).
(ii) and (iii) are proved in exactly the same way.
With this lemma, from the fact that constant functions and
f
(
x
) =
x
are
continuous, we know that all polynomials are continuous. Similarly, rational
functions P (x)/Q(x) are continuous except when Q(x) = 0.
Lemma. Let
A, B ⊆ R
and
f
:
A → B
,
g
:
B → R
. Then if
f
and
g
are
continuous, g ◦f : A → R is continuous.
Proof. We offer two proofs:
(i)
Let (
a
n
) be a sequence in
A
with
a
n
→ a ∈ A
. Then
f
(
a
n
)
→ f
(
a
) since
f
is continuous. Then
g
(
f
(
a
n
))
→ g
(
f
(
a
)) since
g
is continuous. So
g ◦f
is continuous.
(ii)
Let
a ∈ A
and
ε >
0. Since
g
is continuous at
f
(
a
), there exists
η >
0 such
that ∀z ∈ B, |z − f(a)| < η ⇒ |g(z) − g(f(a))| < ε.
Since
f
is continuous at
a
,
∃δ >
0 such that
∀y ∈ A
,
|y − a| < δ ⇒
|f(y) −f(a)| < η. Therefore |y −a| < δ ⇒ |g(f (y)) − g(f(a))| < ε.
There are two important theorems regarding continuous functions — the
maximum value theorem and the intermediate value theorem.
Theorem (Maximum value theorem). Let [
a, b
] be a closed interval in
R
and
let
f
: [
a, b
]
→ R
be continuous. Then
f
is bounded and attains its bounds, i.e.
f(x) = sup f for some x, and f(y) = inf f for some y.
Proof.
If
f
is not bounded above, then for each
n
, we can find
x
n
∈
[
a, b
] such
that f (x
n
) ≥ n for all n.
By Bolzano-Weierstrass, since
x
n
∈
[
a, b
] and is bounded, the sequence
(
x
n
) has a convergent subsequence (
x
n
k
). Let
x
be its limit. Then since
f
is
continuous, f(x
n
k
) → f(x). But f(x
n
k
) ≥ n
k
→ ∞. So this is a contradiction.
Now let
C
=
sup{f
(
x
) :
x ∈
[
a, b
]
}
. Then for every
n
, we can find
x
n
such that
f
(
x
n
)
≥ C −
1
n
. So by Bolzano-Weierstrass, (
x
n
) has a convergent
subsequence (
x
n
k
). Since
C −
1
n
k
≤ f
(
x
n
k
)
≤ C
,
f
(
x
n
k
)
→ C
. Therefore if
x = lim x
n
k
, then f(x) = C.
A similar argument applies if f is unbounded below.
Theorem (Intermediate value theorem). Let
a < b ∈ R
and let
f
: [
a, b
]
→ R
be continuous. Suppose that
f
(
a
)
<
0
< f
(
b
). Then there exists an
x ∈
(
a, b
)
such that f (x) = 0.
Proof. We have several proofs:
(i)
Let
A
=
{x
:
f
(
x
)
<
0
}
and let
s
=
sup A
. We shall show that
f
(
s
) = 0
(this is similar to the proof that
√
2
exists in Numbers and Sets). If
f
(
s
)
<
0, then setting
ε
=
|f
(
s
)
|
in the definition of continuity, we can find
δ >
0 such that
∀y
,
|y − s| < δ ⇒ f
(
y
)
<
0. Then
s
+
δ/
2
∈ A
, so
s
is not
an upper bound. Contradiction.
If
f
(
s
)
>
0, by the same argument, we can find
δ >
0 such that
∀y
,
|y − s| < δ ⇒ f(y) > 0. So s − δ/2 is a smaller upper bound.
(ii)
Let
a
0
=
a
,
b
0
=
b
. By repeated bisection, construct nested intervals
[
a
n
, b
n
] such that
b
n
− a
n
=
b
0
−a
0
2
n
and
f
(
a
n
)
<
0
≤ f
(
b
n
). Then by the
nested intervals property, we can find
x ∈ ∩
∞
n=0
[
a
n
, b
n
]. Since
b
n
−a
n
→
0,
a
n
, b
n
→ x.
Since
f
(
a
n
)
<
0 for every
n
,
f
(
x
)
≤
0. Similarly, since
f
(
b
n
)
≥
0 for every
n, f (x) ≥ 0. So f (x) = 0.
It is easy to generalize this to get that, if
f
(
a
)
< c < f
(
b
), then
∃x ∈
(
a, b
)
such that
f
(
x
) =
c
, by applying the result to
f
(
x
)
− c
. Also, we can assume
instead that f(b) < c < f(a) and obtain the same result by looking at −f(x).
Corollary. Let
f
: [
a, b
]
→
[
c, d
] be a continuous strictly increasing function
with f (a) = c, f(b) = d. Then f is invertible and its inverse is continuous.
Proof.
Since
f
is strictly increasing, it is an injection (suppose
x 6
=
y
. wlog,
x < y
. Then
f
(
x
)
< f
(
y
) and so
f
(
x
)
6
=
f
(
y
)). Now let
y ∈
(
c, d
). By the
intermediate value theorem, there exists
x ∈
(
a, b
) such that
f
(
x
) =
y
. So
f
is a
surjection. So it is a bijection and hence invertible.
Let
g
be the inverse. Let
y ∈
[
c, d
] and let
ε >
0. Let
x
=
g
(
y
). So
f
(
x
) =
y
.
Let
u
=
f
(
x −ε
) and
v
=
f
(
x
+
ε
) (if
y
=
c
or
d
, make the obvious adjustments).
Then
u < y < v
. So we can find
δ >
0 such that (
y − δ, y
+
δ
)
⊆
(
u, v
). Then
|z − y| < δ ⇒ g(z) ∈ (x − ε, x + ε) ⇒ |g(z) − g(y)| < ε.
With this corollary, we can create more continuous functions, e.g.
√
x.