80 CHAPTER 3. METRIC SPACES

3.6 Continuous FunctionsThe following is a fairly general definition of what it means for a function to be continuous.It includes everything seen in typical calculus classes as a special case.

Definition 3.6.1 Let f : X → Y be a function where (X ,d) and (Y,ρ) are metricspaces. Then f is continuous at x ∈ X if and only if the following condition holds. Forevery ε > 0, there exists δ > 0 such that if d (x̂,x) < δ , then ρ ( f (x̂) , f (x)) < ε . If f iscontinuous at every x ∈ X we say that f is continuous on X.

For example, you could have a real valued function f (x) defined on an interval [0,1] . Inthis case you would have X = [0,1] and Y =R with the distance given by d (x,y) = |x− y|.Then the following theorem is the main result.

Theorem 3.6.2 Let f : X → Y where (X ,d) and (Y,ρ) are metric spaces. Then thefollowing two are equivalent.

a f is continuous at x.

b Whenever xn→ x, it follows that f (xn)→ f (x) .

Also, the following are equivalent.

c f is continuous on X .

d Whenever V is open in Y, it follows that f−1 (V )≡ {x : f (x) ∈V} is open in X .

e Whenever H is closed in Y, it follows that f−1 (H)≡ {x : f (x) ∈ H} is closed in X.

Proof: a =⇒ b: Let f be continuous at x and suppose xn→ x. Then let ε > 0 be given.By continuity, there exists δ > 0 such that if d (x̂,x) < δ , then ρ ( f (x̂) , f (x)) < ε. Sincexn→ x, it follows that there exists N such that if n≥ N, then d (xn,x)< δ and so, if n≥ N,it follows that ρ ( f (xn) , f (x))< ε. Since ε > 0 is arbitrary, it follows that f (xn)→ f (x).

b =⇒ a: Suppose b holds but f fails to be continuous at x. Then there exists ε > 0such that for all δ > 0, there exists x̂ such that d (x̂,x)< δ but ρ ( f (x̂) , f (x))≥ ε . Lettingδ = 1/n, there exists xn such that d (xn,x) < 1/n but ρ ( f (xn) , f (x)) ≥ ε . Now this is acontradiction because by assumption, the fact that xn → x implies that f (xn)→ f (x). Inparticular, for large enough n, ρ ( f (xn) , f (x))< ε contrary to the construction.

c =⇒ d: Let V be open in Y . Let x ∈ f−1 (V ) so that f (x) ∈ V. Since V is open, thereexists ε > 0 such that B( f (x) ,ε)⊆V . Since f is continuous at x, it follows that there existsδ > 0 such that if x̂ ∈ B(x,δ ) , then f (x̂) ∈ B( f (x) ,ε) ⊆ V.( f (B(x,δ ))⊆ B( f (x) ,ε))In other words, B(x,δ ) ⊆ f−1 (B( f (x) ,ε)) ⊆ f−1 (V ) which shows that, since x was anarbitrary point of f−1 (V ) , every point of f−1 (V ) is an interior point which implies f−1 (V )is open.

d =⇒ e: Let H be closed in Y . Then f−1 (H)C = f−1(HC)

which is open by assump-tion. Hence f−1 (H) is closed because its complement is open.

e =⇒ d: Let V be open in Y. Then f−1 (V )C = f−1(VC)

which is assumed to be closed.This is because the complement of an open set is a closed set.

d =⇒ c: Let x ∈ X be arbitrary. Is it the case that f is continuous at x? Let ε > 0 begiven. Then B( f (x) ,ε) is an open set in V and so x ∈ f−1 (B( f (x) ,ε)) which is givento be open. Hence there exists δ > 0 such that x ∈ B(x,δ ) ⊆ f−1 (B( f (x) ,ε)) . Thus,f (B(x,δ ))⊆ B( f (x) ,ε) so ρ ( f (x̂) , f (x))< ε . Thus f is continuous at x for every x. ■