Case:1
At x=−1
A function is continuous at x=−1 if L.H.L=R.H.L=f(−1)
limx→1−f(x)=limx→1+f(x)=f(−1)
L.H.L=limx→1−f(x)
=limx→1−(−2)=−2
R.H.L=limx→−1+f(x)
=limx→−1(2x)=2×−1=−2
And f(−2)=−2
Thus, L.H.L=R.H.L=f(−2)=−2
Hence f(x) is continuous at x=−1
Case2:
For x<−1
f(x)=−2
Thus, f(x) is a constant function and every constant function is continuous for all real number.
Hence f(x) is continuous at x<−1
Case3:
For x>1
f(x)=2
Thus, f(x) is a constant function and every constant function is continuous for all real number.
Hence f(x) is continuous at x>1
Case4
For −1≤x≤1
f(x)=2x
So, f(x) is a polynomial and every polynomial is continuous.
⇒f(x) is continuous at −1<x≤1
Thus, f(x) is continuous for all real numbers.
∴f is continuous for all x∈R