f(x) = ⎧⎪⎨⎪⎩−2, if x≤−12x, if −1<x≤12, if x>1
Here, f(x) ⎧⎪⎨⎪⎩−2, if x≤−12x, if −1<x≤12, if x>1
We have to check the continuity only at x=-1 and 1.
At x=-1, LHL = limx→1− f(x) = limx→1− (-2)=-2
RHL = limx→−1− f(x) = limx→−1− (2x)
Putting x=-1+h as x→−1+ when h→0
∴ limh→0 2(-1+h) = limh→0 (-2+2h)=-2+0=-2
Also, f(-1)=-2
∴ LHL=RHL = f(-1). Thus, f(x) is continuous at x=-1.
At x=1, LHL = limx→−1− f(x) = limx→−1− (2x)
Putting x=1-h as x→1− when x→0
∴ limh→0 [2(2-h)]= limh→0 (2-2h)=2-2×0=2
RHL limx→1+ f(x)= limh→1+(2)=2
Also, f(1)=2×1=2 [∴f(x)=2x]
LHL=RHL=f(1)
Thus, f(x) is continuous at x=1.
Hence, f(x) is continuous for every value of x.