When x<2, We have f(x)=2−x.
We know that, a polynomial function is continuous and differentiable everywhere. So, f(x) is continuous and differentiable for all x<2.
Similarly, f(x) is continuous and differentiable for all x∈[2,4] and x>4.
Thus, the possible points where we have to check the continuity and differentiability of f(x) are x=2 and x=4.
Continuity at x=2:
lim x→2−f(x)=lim x→2−2−x=2−2=0
lim x→2+f(x)=lim x→2+(2−x)(4−x)=0×2=0
and, f(2)=(2−2)(4−2)=0
⇒ lim x→2−f(x)=lim x→2+f(x)=f(2)
So, f(x) is continuous at x=2.
Continuity at x=4:
lim x→4−f(x)=lim x→4−(2−x)(4−x)=(2−4)(4−4)=0
lim x→4+f(x)=lim x→4+(4−x)=(4−4)=0
and, f(4)=(2−4)(4−4)=0
⇒ lim x→4−f(x)=lim x→4+f(x)=f(4)
So, f(x) is continuous at x=4.
Differentiability at x=2:
(LHD at x=2)=lim x→2−f(x)−f(2)x−2=lim x→2−(2−x)−0x−2=lim x→2−−(x−2)x−2=−1
(RHD at x=2)= lim x→2+f(x)−f(2)x−2=lim x→2+(2−x)(4−x)−0x−2=lim x→2+(x−2)(x−4)x−2
=lim x→2+x−4=2−4=−2
Thus, (LHD at x=2)≠(RHD at x=2)
So, f(x) is not differentiable at x=2.
Differentiability at x=4:
(LHD at x=4)=lim x→4−f(x)−f(4)x−4=lim x→4−(2−x)(4−x)−0x−4=lim x→4−(x−2)(x−4)x−4
=lim x→4−(x−2)=2
(RHD at x=4)=lim x→4+f(x)−f(4)x−4=lim x→4+(4−x)−0x−4=lim x→4+−(x−4)x−4=−1
Thus, (LHD at x=4)≠(RHD at x=4)
⇒f(x) is not differentiable at x=4.