3.2. THEOREMS ABOUT CONTINUOUS FUNCTIONS 39

3. If f is continuous at x, f (x) ∈ D(g) ⊆ R, and g is continuous at f (x) ,then g ◦ f iscontinuous at x.

4. The function f : R→ R, given by f (x) = |x| is continuous.

Proof: First consider 1.) Let ε > 0 be given. By assumption, there exist δ 1 > 0such that whenever |x− y| < δ 1, it follows | f (x)− f (y)| < ε

2(|a|+|b|+1) and there existsδ 2 > 0 such that whenever |x− y| < δ 2, it follows that |g(x)−g(y)| < ε

2(|a|+|b|+1) . Thenlet 0 < δ ≤min(δ 1,δ 2) . If |x− y|< δ , then everything happens at once. Therefore, usingthe triangle inequality

|a f (x)+b f (x)− (ag(y)+bg(y))|

≤ |a| | f (x)− f (y)|+ |b| |g(x)−g(y)|

< |a|(

ε

2(|a|+ |b|+1)

)+ |b|

2(|a|+ |b|+1)

)< ε.

Now consider 2.) There exists δ 1 > 0 such that if |y− x|< δ 1, then

| f (x)− f (y)|< 1.

Therefore, for such y,| f (y)|< 1+ | f (x)| .

It follows that for such y,

| f g(x)− f g(y)| ≤ | f (x)g(x)−g(x) f (y)|+ |g(x) f (y)− f (y)g(y)|

≤ |g(x)| | f (x)− f (y)|+ | f (y)| |g(x)−g(y)|≤ (1+ |g(x)|+ | f (y)|) [|g(x)−g(y)|+ | f (x)− f (y)|] .

Now let ε > 0 be given. There exists δ 2 such that if |x− y|< δ 2, then

|g(x)−g(y)|< ε

2(1+ |g(x)|+ | f (y)|),

and there exists δ 3 such that if |x−y|< δ 3, then

| f (x)− f (y)|< ε

2(1+ |g(x)|+ | f (y)|)

Now let 0 < δ ≤min(δ 1,δ 2,δ 3) . Then if |x−y|< δ , all the above hold at once and so

| f g(x)− f g(y)| ≤

(1+ |g(x)|+ | f (y)|) [|g(x)−g(y)|+ | f (x)− f (y)|]

< (1+ |g(x)|+ | f (y)|)(

ε

2(1+ |g(x)|+ | f (y)|)+

ε

2(1+ |g(x)|+ | f (y)|)

)= ε.