The function \(f(x)=\left||x|+1-x\right|\) is:
Answer & explanation
Correct answer: option 3
The correct answer is Option (3) → continuous everywhere and differentiable at all points except at \(x=0\)
Remove the inner modulus by taking x ≥ 0 and x < 0 separately.
For x ≥ 0, |x| = x:
\(f(x) = |x + 1 - x| = |1| = 1\)
For x < 0, |x| = −x, and 1 − 2x > 0:
\(f(x) = |-x + 1 - x| = |1 - 2x| = 1 - 2x\)
So
\( \displaystyle f(x) = \begin{cases}1 - 2x, & x \lt 0\\ 1, & x \ge 0\end{cases} \)
Each piece is a polynomial, so f is continuous and differentiable at every x ≠ 0. At x = 0:
\( \displaystyle \lim_{x\to 0^-}(1 - 2x) = 1 = f(0) \)
so f is continuous at 0 too, hence continuous everywhere. The slopes of the two pieces give
\(\text{left derivative at } 0 = -2,\quad \text{right derivative at } 0 = 0\)
The left and right derivatives differ, so f is not differentiable at x = 0, and only there.