SOLUTIONS MANUAL
, Solutions to Chapter 2 exercises
2.1 Let x ∈ (X \ C) ∩ D. Then x ∈ X, x ∈ D, x ∈ C. So x ∈ D, x ∈ C which gives x ∈ D \ C .
Hence (X \ C) ∩ D ⊆ D \ C .
Conversely, if x ∈ D \ C then x ∈ C so x ∈ X \ C , and x ∈ D . So x ∈ (X \ C) ∩ D . Hence
D \ C ⊆ (X \ C) ∩ D.
Together these prove that (X \ C) ∩ D = D \ C .
2.2 Suppose that x ∈ A \ (V ∩ A). Then x ∈ A and x ∈ V ∩ A so x ∈ V. Then x ∈ A and
x ∈ X \ V so x ∈ A ∩ (X \ V ). Hence A \ (V ∩ A) ⊆ A ∩ (X \ V ).
Conversely suppose x ∈ A∩(X \V ). Then x ∈ A and x ∈ X \V so x ∈ V , hence x ∈ V ∩A.
This shows that x ∈ A \ (V ∩ A). Hence A ∩ (X \ V ) ⊆ A \ (V ∩ A).
Together these prove that A \ (V ∩ A) = A ∩ (X \ V ).
2.3 Suppose that x ∈ V . Then x ∈ X and x ∈ X \ V = X ∩ U , so x ∈ U . So x ∈ X ⊆ Y and
x ∈ U so x ∈ Y \ U . This gives x ∈ X ∩ (Y \ U). Hence V ⊆ X ∩ (Y \ U).
Conversely suppose that x ∈ X ∩ (Y \ U). Then x ∈ X , and x ∈ U , so x ∈ X ∩ U = X \ V .
Hence x ∈ V . Hence X ∩ (Y \ U) ⊆ V .
Together these show that V = X ∩ (Y \ U).
2.4 If (a, b) ∈ U × V then a ∈ U so (a, b) ∈ U × Y and b ∈ V so (a, b) ∈ X × V . Hence
(a, b) ∈ (X × V ) ∩ (U × Y ). So U × V ⊆ (X × V ) ∩ (U × Y ).
Conversely if (a, b) ∈ (X × V ) ∩ (U × Y ), then b ∈ V and a ∈ U so (a, b) ∈ U × V . Hence
(X × V ) ∩ (U × Y ) ⊆ U × V .
Together these give U × V = (X × V ) ∩ (U × Y ).
2.5 If (x, y) ∈ (U1 × V1 ) ∩ (U2 × V2 ) then x ∈ U1 and x ∈ U2 so x ∈ U1 ∩ U2 , and similarly
y ∈ V1 ∩ V2 , so (x, y) ∈ (U1 ∩ U2 ) × (V1 ∩ V2 ). This shows that
(U1 × V1 ) ∩ (U2 × V2 ) ⊆ (U1 ∩ U2 ) × (V1 ∩ V2 ).
Conversely if x ∈ (U1 ∩ U2 ) × (V1 ∩ V2 ) then x ∈ U1 , x ∈ U2 , y ∈ V1 , y ∈ V2 so (x, y) ∈ U1 × V1
and also (x, y) ∈ U2 × V2 , so (x, y) ∈ (U1 × V1 ) ∩ (U2 × V2 ). This shows that
(U1 ∩ U2 ) × (V1 ∩ V2 ) ⊆ (U1 × V1 ) ∩ (U2 × V2 ).
Together these show that (U1 × V1 ) ∩ (U2 × V2 ) = (U1 ∩ U2 ) × (V1 ∩ V2 ).
,
2.6 If x ∈ U ∩ V then x ∈ Bi1 and x ∈ Bj2 , so for some i0 ∈ I and j0 ∈ J we have
i∈I j∈J
x ∈ Bi0 1 and x ∈ Bj0 2 , so
x ∈ Bi0 1 ∩ Bj0 2 ⊆ Bi1 ∩ Bj2 .
(i, j)∈I×J
Hence
U ∩V ⊆ Bi1 ∩ Bj2 .
(i, j)∈I×J
Conversely, if x ∈ Bi1 ∩ Bj2 then for some i0 ∈ I and j0 ∈ J we have x ∈ Bi0 1 ∩ Bj0 2 ,
(i, j)∈I×J
so x ∈ Bi0 1 ⊆ U and similarly x ∈ V so x ∈ U ∩ V . Hence
Bi1 ∩ Bj2 ⊆ U ∩ V.
(i, j)∈I×J
Together these show that
U ∩V = Bi1 ∩ Bj2.
(i, j)∈I×J
2.7 (a) Let the distinct equivalence classes be {Ai : i ∈ I}. Each Ai , being an equivalence class,
satisfies Ai ⊆ X. To see that the distinct equivalence classes are disjoint, suppose that for some
i, j ∈ I and some x ∈ X we have x ∈ Ai ∩ Aj . Then for any a ∈ Ai we have a ∼ x and x ∈ Aj ,
hence a ∈ Aj . This shows Ai ⊆ Aj . Similarly Aj ⊆ Ai . But this shows that Ai = Aj . Thus
distinct equivalence classes are mutually disjoint. Finally, any x ∈ X is in some equivalence
class with respect to ∼, so X ⊆ Ai . Also, since each Ai is a subset of X we have Ai ⊆ X .
i∈I i∈I
So X = Ai .
i∈I
(b) We define x1 ∼ x2 iff x1 , x2 ∈ Ai for some i ∈ I . This is reflexive since each x ∈ X is
in some Ai so x ∼ x. It is symmetric since if x1 ∼ x2 then x1 , x2 ∈ Ai for some i ∈ I , and
then also x2 , x1 ∈ Ai so x2 ∼ x1 . Finally it is transitive since if x1 ∼ x2 and x2 ∼ x3 then
x1 , x2 ∈ Ai for some i ∈ I and x2 , x3 ∈ Aj for some j ∈ I . Now x2 ∈ Ai ∩ Aj , and since
Ai ∩ Aj = ∅ for i = j , we must have i = j . Hence x1 , x3 ∈ Ai and we have x1 ∼ x3 as required
for transitivity.
2.8 Let ∼ be an equivalence relation on the set X . Then P(∼) = {Ai : i ∈ I}, where x1 ∼ x2 iff
x1 , x2 ∈ Ai for some i ∈ I . The equivalence relation ∼′ =∼ (P(∼)) is then defined by x1 ∼′ x2
iff x1 , x2 ∈ Ai for some i ∈ I , which says that ∼′ =∼, that is ∼ (P(∼)) =∼.
If we begin with a partition P = {Ai : i ∈ I}, then ∼ (P) is the equivalence relation ∼′
defined by x1 ∼′ x2 iff x1 , x2 ∈ Ai for some i ∈ I , and then clearly P(∼′ ) = P . This says that
P(∼ (P)) = P .
, Solutions to Chapter 3 exercises
3.1 Suppose that y ∈ f (A). Then y = f (a) for some a ∈ A. Since A ⊆ B , also a ∈ B so
y = f (a) ∈ f (B). By definition, f (B) ⊆ Y . This shows that f (A) ⊆ f (B) ⊆ Y.
Suppose that x ∈ f −1 (C). Then f (x) ∈ C , so since C ⊆ D also f (x) ∈ D. Hence
x ∈ f −1 (D). By definition f −1 (D) ⊆ X . This shows that f −1 (C) ⊆ f −1 (D) ⊆ X.
3.2 We see, either from a sketch or arguing analytically, that
f ([0, π/2]) = [0, 1], f ([0, ∞)) = [−1, 1], f −1 ([0, 1]) = [2nπ, (2n + 1)π],
n∈Z
f −1 ([0, 1/2]) = ([2nπ, (2n + 1/3)π] ∪ [(2n + 2/3)π, (2n + 1)π]), f −1 ([−1, 1]) = R.
n∈Z
3.3 First suppose that x ∈ (g ◦ f )−1 (U). Then g(f (x)) = (g ◦ f )(x) ∈ U . Hence by definition
of inverse images, f (x) ∈ g −1 (U), and again by definition x ∈ f −1 (g −1 (U)). This shows that
(g ◦ f )−1 (U) ⊆ f −1 (g −1 (U)).
Now suppose x ∈ f −1 (g −1 (U)). Then f (x) ∈ g −1 (U), so g(f (x)) ∈ U , that is (g ◦ f )(x) ∈ U ,
and by definition of inverse images, x ∈ (g ◦ f )−1 (U). Hence f −1 (g −1 (U)) ⊆ (g ◦ f )−1 (U).
These together show that (g ◦ f )−1 (U) = f −1 (g −1 (U)).
3.4 We see that
f ([0, 1]) = {(x, 2x) : x ∈ [0, 1]}, which is the straight line segment in R2 joining the origin
to the point with coordinates (1, 2).
We see that (x, 2x) ∈ [0, 1] × [0, 1] iff 0 x 1/2, so f −1 ([0, 1] × [0, 1]) = [0, 1/2].
We see that (x, 2x) ∈ D iff x ∈ R and x2 + (2x)2 1, which holds iff 5x2 1, so
√ √
f −1 (D) = [−1/ 5, 1/ 5].
3.5 We know from Proposition 3.14 in the book that if f : X → Y is onto and C ⊆ Y then
f (f −1 (C)) = C.
Suppose that f : X → Y is such that f (f −1(C)) = C for any subset C of Y . For any y ∈ Y
we can put C = {y}, and get that f (f −1(y)) = {y}. This tells us that there exists x ∈ f −1 (y)
(for which of course f (x) = y ) so f −1 (y) = ∅. This proves that f is onto.
,3.6 Let f : X → Y . We know from Proposition 3.14 in the book that A ⊆ f −1 (f (A)) for any
A ⊆ X . Suppose that f is injective and let x ∈ f −1 (f (A)). Then f (x) ∈ f (A) so f (x) = f (a)
for some a ∈ A. But f is injective so x = a. This proves that f −1 (f (A)) ⊆ A, and together
these give A = f −1 (f (A)).
Now suppose that A = f −1 (f (A)) for any A ⊆ X . For any x ∈ X take A = {x} and we get
{x} = f −1 (f (x)). this says that if f (x′ ) = f (x) then x′ = x, that is f is injective.
3.7 (i) We can have y = y ′ with neither y nor y ′ in the image of f , so that f −1 (y) = f −1 (y ′) = ∅.
For a concrete counterexample, define f : {0} → {0, 1, 2} by f (0) = 0 and take y = 1, y ′ = 2.
(ii) Suppose that f : X → Y is onto and y, y ′ ∈ Y with y = y ′. Then f −1 (y) = f −1 (y ′);
for if f −1 (y) = f −1 (y ′), then there exists x ∈ f −1 (y) = f −1 (y ′) since f is onto. This gives the
contradiction y = f (x) = y ′ .
3.8 We know from Proposition 3.9 in the book that f (A) \ f (B) ⊆ f (A \ B) for any subsets
A, B of X .
Suppose first that also f (A\B) ⊆ f (A)\f (B). Then if y ∈ f (A\B) we know that y ∈ f (B).
Hence f (A \ B) ∩ f (B) = ∅.
Conversely suppose that f (A \ B) ∩ f (B) = ∅. Let y ∈ f (A \ B). Then y ∈ f (B). Also,
y = f (x) for some x ∈ A\B . Thus y ∈ f (A), but y ∈ f (B), so y ∈ f (A)\f (B). This proves that
f (A \ B) ⊆ f (A) \ f (B), and together with the opening remark we have f (A \ B) = f (A) \ f (B).
If f (A \ B) ∩ f (B) = ∅, let y ∈ f (A \ B) ∩ f (B). Then y = f (x) for some x ∈ A \ B and also
y = f (x′ ) for some x′ ∈ B , and we have x′ = x, so f is not injective. Hence if f is injective
then f (A \ B) ∩ f (B) = ∅ and f (A \ B) = f (A) \ f (B) by the first part of the question.
3.9 (a) Suppose that y ∈ f (A) ∩ C. Then y ∈ C , and y = f (x) for some x ∈ A. Then
x ∈ f −1 (C), so x ∈ A∩f −1 (C) and y = f (x) ∈ f (A∩f −1 (C)). Hence f (A)∩C ⊆ f (A∩f −1 (C)).
Conversely suppose y ∈ f (A ∩ f −1 (C)). Then y = f (x) for some x ∈ A ∩ f −1 (C). Then
y ∈ f (A) since x ∈ A and y = f (x) ∈ C since x ∈ f −1 (C). Hence f (A ∩ f −1 (C)) ⊆ f (A) ∩ C .
Together these show that f (A) ∩ C = f (A ∩ f −1 (C)).
(b) We apply (a) with C = f (B). This tells us that f (A) ∩ f (B) = f (A ∩ f −1 (f (B))), so since
f −1 (f (B)) = B we have f (A) ∩ f (B) = f (A ∩ B).
3.10 Each f −1 (y) for y ∈ Y is non-empty since f is onto. If y, y ′ ∈ Y with y = y ′ then we can
see that f −1 (y) ∩ f −1 (y ′) = ∅ since if x ∈ f −1 (y) ∩ f −1 (y ′) then y = f (x) = y ′ , contradicting
the hypothesis. Finally, f −1 (y) = X by Proposition 3.7 in the book, since {y} = Y .
y∈Y y∈Y
, Solutions to Chapter 4 exercises
4.1 Suppose that u is an upper bound for B . Then since A ⊆ B we have a u for all a ∈ A.
So A is bounded above. In particular, since supB is an upper bound for B , it is an upper
bound for A. Hence sup A sup B .
4.2 For any x ∈ A ∪ B , either x ∈ A so x sup A max{sup A, sup B}, or x ∈ B so
x sup B max{sup A, sup B}. Hence max{sup A, sup B} is an upper bound for A ∪ B , so
A ∪ B is bounded above and sup(A ∪ B) max{sup A, sup B}.
Now let u = max{sup A, sup B} and let ε > 0. If u = sup A then there exists x ∈ A with
x > u − ε. Similarly if u = sup B then there exists x ∈ B with x > u − ε. In either case
there exists x ∈ A ∪ B with x > u − ε. Hence u is the least upper bound of A ∪ B , that is
sup(A ∪ B) = max{sup A, sup B}.
4.3(a) We prove that if ∅ =
A ⊆ B and if B is bounded below then A is bounded below and
inf A inf B . For if l is an lower bound for B then a l for all a ∈ A, since A ⊆ B . So A is
bounded below. In particular inf B is a lower bound for A, so inf A inf B .
(b) We prove that if A and B are non-empty subsets of R which are bounded below then
A ∪ B is bounded below and inf(A ∪ B) = min{inf A, inf B}. For let l = min{inf A, inf B}. If
x ∈ A ∪ B then either x ∈ A so x inf A l, or x ∈ B so x inf B l. In either case x l.
Hence l is a lower bound for A ∪ B , so A ∪ B is bounded below and inf(A ∪ B) l. Now let
ε > 0. If l = inf A then there exists x ∈ A such that x < l + ε, and if l = inf B then there
exists x ∈ B with x < l + ε. In either case there exists x ∈ A ∪ B such that x < l + ε. Hence l
is the greatest lower bound of A ∪ B . We now have inf(A ∪ B) = min{inf A, inf B} as required.
4.4 For any real number x we have (x − 1)2 0 so x2 2x − 1. Hence x2 2x − 1 iff
x2 = 2x − 1, i.e. iff (x − 1)2 = 0 which holds iff x = 1. So the first set is S = {1} whose sup 1
is in S .
From the graph of the quadratic function x → x2 + 2x − 1 we see that for x a real number,
x2 + 2x 1 iff x lies between the two roots of the quadratic equation x2 + 2x − 1 = 0, that is
√ √ √
iff −1 − 2 x −1 + 2. Hence in this case the set is bounded above, and its sup −1 + 2
is in the set.
For a real number x we have x3 < 8 iff x < 2, so the sup of the set is 2 which is not in the
set.
In this case the set is not bounded above, since no matter how large K is, we can find an
integer n with 2nπ > K , and then if we put x = 2nπ we have x in the set, since x sin x = 0 < 1,
but x > K.
,4.5 Suppose for a contradiction that q 2 = 2 where q = m/n, with m, n mutually prime integers.
Then m2 = 2n2 . Now 2 divides the right-hand side of this equation, hence 2|m2 (2 divides
m2 ). Since 2 is prime, we must have 2|m. So in fact 4|m2 , and from the equation again, 2|n2
so 2|n. But now we have 2|m and 2|n, contradicting the hypothesis that m and n are mutually
prime. Hence there is no such rational number q .
4.6 Suppose that m/n = (r/s)2 where r and s are mutually prime integers. Then ms2 = nr 2 ,
so r 2 divides ms2 (r 2 |ms2 ). Now since r and s are mutually prime, r 2 |m, say m = r 2 k for
some integer positive k . But from ms2 = nr 2 we get ks2 = n, so k|n but k|m, so we must have
k = 1. This shows that m = r 2 is the square of an integer. From ms2 = nr 2 we get n = s2 so
n is also the square of an integer.
The converse, that if both m and n are squares of integers then m/n is the square of a
rational number, is immediate.
4.7 Suppose that S is a non-empty set of real numbers which is bounded below, say s k for
all s ∈ S . Let −S mean the set {x ∈ R : −x ∈ S}. Then for any x ∈ −S we have −x ∈ S so
−x k which gives x −k . This shows that −S is bounded above, so by the completeness
property −S has a least upper bound, sup(−S). Put l = − sup(−S). For any y ∈ S we have
−y ∈ −S so −y sup(−S), whence y − sup(−S) = l. Thus l is a lower bound for S .
Now let l′ be any lower bound for S , so that y l′ for any y ∈ S . Then −y −l′ for any
y ∈ S , which says that x −l′ for any x ∈ −S . Thus −l′ is an upper bound for −S , and by
leastness of sup(−S) we have −l′ sup(−S). This gives l′ − sup(−S) = l. So l is a greatest
lower bound for S .
4.8 We first need to establish the existence of at least one irrational number. We choose to do
√
this for 2. So we have to show that there is a (positive) real number u satisfying u2 = 2. We
give two proofs: the first uses only the properties of real numbers mentioned in the book up to
the completeness property; the second is more streamlined, but uses later results.
Let S = {x ∈ R : x2 2}. Then S = ∅, since for example 1 ∈ S . Also, S is bounded above
- for example 2 is an upper bound, since if x 2 then x2 4. So by the completeness property
S has a sup, say u. Note that since 1 ∈ S we have u 1 > 0. Next we show that each of
u2 < 2 and u2 > 2 leads to a contradiction.
First suppose u2 < 2. Consider u + 1/n for integers n. We show that for n large enough,
u + 1/n ∈ S, so u is not an upper bound for S . For (u + 1/n)2 = u2 + 2u/n + 1/n2 , so it is
enough to show that for large enough n we have 2u/n + 1/n2 < 2 − u2 , for then (u + 1/n)2 < 2
and u + 1/n ∈ S. Now choose an integer n so that 1/n < (2 − u2 )/4u and also 1/n < 2u (we
can do this since u > 0). Then 2u/n < (2 − u2 )/2 and 1/n2 < 2u/n, so 2u/n + 1/n2 < 2 − u2
as required.
, Now suppose u2 > 2. Consider u − 1/n for integers n. We shall show that if n is large
enough than u − 1/n is an upper bound for S , contradicting leastness of u. Choose n so that
1/n < (u2 − 2)/2u and also 1/n < u. Then
2u/n < u2 − 2, so (u − 1/n)2 = u2 − 2u/n + 1/n2 > u2 − 2u/n > u2 − (u2 − 2) = 2.
Now if x ∈ S , so x is a real number with x2 < 2, we have x2 < 2 < (u − 1/n)2 . Then
since u − 1/n > 0 we have x < u − 1/n. This shows that u − 1/n is an upper bound for S ,
contradicting leastness of U as mentioned.
The above two paragraphs together show that u2 = 2.
For a shorter proof, we use later results as follows. Consider the function f : [1, 2] → R
defined by f (x) = x2 . Then f is continuous by Proposition 4.32. Also, f (1) = 1, f (2) = 4. So
by the intermediate value theorem, there is some u ∈ [1, 2] such that f (u) = 2, in other words
u2 = 2.
Now from Exercise 4.5 we know that u cannot be rational. From the existence of this one
irrational real number we can answer the question. Suppose first that r, y are real numbers
√
with r < y and r rational. We may choose an integer n such that 2/n < y − r . Then
√ √ √ √
r < r + 2/n < y , and r + 2/n is irrational, since if it were rational 2/n = (r + 2/n) − r
√ √
would be rational, hence 2 = n. 2/n would be rational. Now suppose that x, y are real
numbers with x < y . By Corollary 4.7 of the book, there is a rational number r with x < r < y .
Now by the above there is an irrational number z with r < z < y , and then also x < z < y as
required.
4.9 Since y > 1 we have y = 1 + x for some x > 0. Hence y n = (1 + x)n . Choose some integer
r with r > α, and let n > r . Then
n(n − 1)(n − 2) . . . (n − r + 1)xr
(1 + x)n > ,
r!
nα r!nα
so 0 < → 0 as n → ∞,
yn n(n − 1)(n − 2) . . . (n − r + 1)xr
since there are r factors on the denominator involving n, and r > α. The result now follows by
the ‘sandwich principle’.
4.10 Let n > 1. Then n1/n > 1 (since n1/n 1 implies n 1). So for n > 1 we may write
n1/n = 1+an with an > 0. Since (1+an )n = (n1/n )n = n, n = (1+an )n 1+nan +n(n−1)a2n /2
for n 2. In particular for n 2 we have n > 1 + n(n − 1)a2n /2, so n − 1 > n(n − 1)a2n /2.
Hence for n 2 we have 0 < a2n < 2/n. This proves that a2n → 0 as n → ∞, hence also an → 0
as n → ∞.∗ So n1/n = 1 + an → 1 as n → ∞.
The asterisked statement is not obvious. Given ε > 0, there exists N such that 0 < a2n < ε2
for all n N . Since an > 0 this gives 0 < an < ε for all n N , and an → 0 as n → ∞.
,4.11 Suppose a = ai0 . Then an = ani0 an1 + an2 + . . . + anr . Also, for each i ∈ {1, 2, . . . , r}, we
have ai a so ani an . Hence an1 + an2 + . . . + anr ran . As the hint suggests, we now take
nth roots and get
a (an1 + an2 + . . . + anr )1/n r 1/n a.
Now r 1/n → 1 as n → ∞ (we can deduce this from Exercise 4.10, since 1 < r 1/n < n1/n for all
n > r ), so by the sandwich principle for limits, (an1 + an2 + . . . + anr )1/n → a as n → ∞.
4.12 Let f, g : R → R be defined by: f (x) = 0 for all x ∈ R,
1 if x = 0
g(x) =
0 when x = 0
Then f (x) → 0 as x → 0 and g(y) → 1 as y → 0 but g(f (x)) → 0 = 1 as x → 0.
4.13(a) If y z then max{y, z} = y and |y − z| = y − z so (y + z + |y − z|)/2 = y . If y z
then max{y, z} = z and |y − z| = z − y so (y + z + |y − z|)/2 = z.
If y z then min{y, z} = z and |y − z| = y − z so (y + z − |y − z|)/2 = z . If y z then
min{y, z} = y and |y − z| = z − y so (y + z − |y − z|)/2 = y .
(b) We use (a) to see that for each x ∈ R,
1 1
h(x) = (f (x) + g(x) + |f (x) − g(x)|), k(x) = (f (x) + g(x) − |f (x) − g(x)|).
2 2
Now f, g are continuous, hence f + g and f − g are continuous by Proposition 4.31 (we note
that the constant function x → −1 is continuous, hence −g is continuous since g is continuous).
Hence, again by Proposition 4.31, |f − g| is continuous, f + g ± |f − g| is continuous, so h, k
are continuous.
4.14 For all x ∈ R, | sin 1/x| 1 so 0 |x sin 1/x| |x|. From this it follows by the sandwich
principle that x sin 1/x → 0 as x → 0.
Suppose for a contradiction that lim sin 1/x exists and is, say, l. The idea of the proof is
x→0
that there are points x1 , x2 arbitrarily close to 0 such that sin 1/x1 = 0 and sin 1/x2 = 1, and
there’s no way that both of these can be very close to l.
To say this formally, take “ε” in the definition of limit to be 1/2. Then there exists δ > 0
such that for any x with 0 < |x| < δ we have | sin 1/x − l| < 1/2. But we may choose
an integer n such that 1/2nπ < δ . Now let x1 = 1/2nπ and x2 = 1/(2n + 1/2)π . Then
sin 1/x1 = 0, sin 1/x2 = 1. So we get the contradiction
1 = | sin 1/x1 −sin 1/x2 | = | sin 1/x1 −l+l−sin 1/x2 | | sin 1/x1 −l|+|l−sin 1/x2 | < 1/2+1/2 = 1.
Hence lim sin 1/x cannot exist.
x→0
, 4.15 Let x ∈ R and take ε = 1/2. If f were continuous at x there would exist δ > 0 such that
|f (x) − f (x′ | < 1/2 for any y ∈ R such that |y − x| < δ . Now we know from Corollary 4.7 and
Exercise 4.8 that there exist both a rational number x1 and an irrational number x2 between x
and x + δ . Thus |x − x1 | < δ and |x − x2 | < δ . Hence we should have |f (x) − f (x1 )| < 1/2 and
|f (x) − f (x2 )| < 1/2, which give
|f (x1 ) − f (x2 | |f (x1 ) − f (x)| + |f (x) − f (x2 )| < 1.
But in fact f (x1 ) = 0 and f (x2 ) = 1, so |f (x1 ) − f (x2 )| = 1. This contradiction shows that f
is not continuous at x.
4.16 First let a ∈ Q\ {0}, say a = p/q where p, q have highest common factor 1 and q > 0. Let
us temporarily say that such rational numbers are ‘in normal form’. Then f (a) = 1/q . Suppose
for a contradiction that f is continuous at a. Take “ε” in the definition of continuity of f at a
to be 1/q . Then there exists δ > 0 such that |f (x) − f (a)| < 1/q whenever |x − a| < δ . But by
Exercise 4.8 there exists an irrational number x between a and a + δ . For such an x we have
|x − a| < δ but |f (x) − f (a)| = 1/q since f (x) = 0. This contradiction shows that f is not
continuous at a.
Next let a be irrational or a = 0. To prove continuity of f at a, let ε > 0. For a given
positive integer q there are only a finite number of rational numbers p/q in normal form in
the interval (a − 1, a + 1). Hence there are only a finite number of (non-zero) rationals p/q in
normal form in (a − 1, a + 1) with q 1/ε. Call these rational numbers {r1 , r2 , . . . , rn }, and
choose δ be the lesser of 1 and min{|a − ri | : i = 1, 2, . . . , n}. Then δ > 0. If r = p/q is a
rational number in normal form satisfying |r − a| < δ then we must have q > 1/ε, and hence
|f (r) − f (a)| = |f (r)| = 1/q < ε. Now for any x satisfying |x − a| < δ we have either x is
0 or irrational, in which case f (x) = 0 = f (a) and certainly |f (x) − f (a)| < ε, or x = p/q
is a rational number in normal form with 1/q < ε and |f (x) − f (a)| = 1/q < ε. This proves
continuity of f at a when a is irrational or 0.
4.17 We use the fact that the graph of a convex funtion is convex, that is if x, y are real numbers
with x < y then the straight line segment joining the points (x, f (x)) and (y, f (y)) lies above
or on the graph of f between x and y , as indicated in Fig. 1.
✻
✟✟
f (y) r
✟✟
f (x) r ✟
r r ✲
x y
Figure 1: Convexity