Solution:
Key idea: A function is continuous at x=a when LHL, RHL and f(a) are equal. It is differentiable at x=a when the left-hand derivative Lf′(a) and the right-hand derivative Rf′(a) exist and are equal, where, with h>0 and h→0,
Lf′(a)Rf′(a)=h→0lim−hf(a−h)−f(a)=h→0limhf(a+h)−f(a)
Step 1 — Write f without modulus signs.
The points −1 and 1 cut the real line into three intervals. On each one we remove the modulus signs.
For x<−1:f(x)=−(x−1)−(x+1)=−2x
For −1≤x≤1:f(x)=−(x−1)+(x+1)=2
For x>1:f(x)=(x−1)+(x+1)=2x
So f(−1)=2 and f(1)=2.
Step 2 — Find the one-sided derivatives at x = 1.
Just left of 1 the rule is the constant 2; just right of 1 it is 2x.
Lf′(1)=h→0lim−h2−2=0
Rf′(1)=h→0limh2(1+h)−2=h→0limh2h=2
Since 0=2, f is not differentiable at x=1.
Step 3 — Find the one-sided derivatives at x = -1.
Just left of −1 the rule is −2x; just right of −1 it is the constant 2.
Lf′(−1)=h→0lim−h−2(−1−h)−2=h→0lim−h2h=−2
Rf′(−1)=h→0limh2−2=0
Since −2=0, f is not differentiable at x=−1.
Therefore, f is not differentiable at x=−1 and at x=1 (proved).