Given, f(x) = | x | + | x – 1 |
It can be written as

Here, we will test of continuity at x = 0 and x = 1 only.
Test of continuity at x = 0
Here, f(0) = 1
Left hand limit
f(0 – 0) = limh→0 f(0 – h)
= limh→0 1 – 2(0 – h)
= 1
Right hand limit
f(0 + 0) = limh→0 f(0 + h)
= 1
∴ f(0) = f (0 – c) = f (0 + 0)
So, at x = 0,f(x) is continuous
Now, at x = 1 test of continuity
Here, f(1) = 2 × 1 – 1 = 1
Left hand limit
f (1 – 0) = limh→0 f(1 – h)
= limh→0 1
Right hand limit
f (1 + 0) = limh→0 f(1 + h)
= limh→0 2(1 + h) – 1
= 2(1 + 0) – 1
= 2 – 1 = 1
∴ f (1) = f(1 – 0) = f(1 + 0)
So, at x = 1, f(x) is continuous.
∴ Function is continuous at x = 0 and x = 1
Hence, function is continuous in interval [-1,2].