Show that the function defined by f (x) = | cos x| is a continuous function.

It is given that f(x) = |cosx|

The given function f is defined for real number and f can be written as the composition of two functions, as


f = goh, where g(x) = |x| and h(x) = cosx


First we have to prove that g(x) = |x| and h(x) = cosx are continuous functions.


g(x) = |x| can be written as



Now, g is defined for all real number.


Let k be a real number.


Case I: If k < 0,


Then g(k) = -k


And


Thus,


Therefore, g is continuous at all points x, i.e., x > 0


Case II: If k > 0,


Then g(k) = k and



Thus,


Therefore, g is continuous at all points x, i.e., x < 0.


Case III: If k = 0,


Then, g(k) = g(0) = 0





Therefore, g is continuous at x = 0


From the above 3 cases, we get that g is continuous at all points.


h(x) = cosx


We know that h is defined for every real number.


Let k be a real number.


Now, put x = k + h


If






= coskcos0 – sinksin0


= cosk × 1 – sin × 0


= cosk



Thus, h(x) = cosx is continuous function.


We know that for real valued functions g and h, such that (goh) is defined at k, if g is continuous at k and if f is continuous at g(k),


Then (fog) is continuous at k.


Therefore, f(x) = (gof)(x) = g(h(x)) = g(cosx) = |cosx| is a continuous function.


33