f(x)=|x−1|+|x−2|+|x−3|
Also, f(a−)=limx→a−f(x) and f(a+)=limx→a+f(x)
f(1−)=−(x−1)+1+2=3, f(1+)=(x−1)+1+2=3 Hence, continuous at x=1
f(2−)=1−(x−2)+1=2, f(2+)=1+(x−2)+1=2 Hence, continuous at x=2
f(3−)=2+1−(x−3)=3, f(3+)=2+1+(x−3)=3 Hence, continuous at x=3
Hence, the function is continuous on R as these 3 points were the ones of change.
But, apart from continuity differentiability also needs to be checked.
At x=1,
Lf′(1)=limh→0−f(1+h)−f(1)h=limh→0−|1+h−1|+1+2−3h=limh→0−−hh=−1
Rf′(1)=limh→0+f(1+h)−f(1)h=limh→0+|1+h−1|+1+2−3h=limh→0+hh=1
As Lf′(1)≠Rf′(1), function is non-derivable at x=1
At x=2,
Lf′(2)=limh→0−f(2+h)−f(2)h=limh→0−1+|2+h−2|+1−2h=limh→0−−hh=−1
Rf′(2)=limh→0+f(2+h)−f(2)h=limh→0+1+|2+h−2|+1−2h=limh→0+hh=1
As Lf′(2)≠Rf′(2), function is non-derivable at x=2
At x=3,
Lf′(3)=limh→0−f(3+h)−f(3)h=limh→0−|3+h−3|+1+2−3h=limh→0−−hh=−1
Rf′(3)=limh→0+f(3+h)−f(3)h=limh→0+|3+h−3|+1+2−3h=limh→0+hh=1
As Lf′(3)≠Rf′(3), function is non-derivable at x=3
At x=k where k≠{1,2,},
Lf′(k)=limh→0−f(k+h)−f(k)h
=limh→0−|k+h−1|+|k+h−2|+|k+h−3|−(|k−1|+|k−2|+|k−3|)h=limh→0−0h=0
Rf′(1)=limh→0+f(k+h)−f(k)h
=limh→0+|k+h−1|+|k+h−2|+|k+h−3|−(|k−1|+|k−2|+|k−3|)h=limh→0+0h=0
As Lf′(k)=Rf′(k), function is derivable at x=k.
Hence, proved.