Why would the |f(x)| be non differentiable for x belonging to Real Numbers

calculuscontinuityderivativesgraphing-functionspiecewise-continuity

I'm just started calculus and come across a statement in 1 of my books (VG Advanced Problems in Mathematics) that goes like:

If $y = f(x)$ is differentiable for x belonging to the set of Real numbers, then $y=|f(x)|$ is not differentiable for all x belonging to the set of Real numbers.

So what I inferred initially is that modulus function are continuous but non differentiable at the point where $f(x)=0$ (where $f(x)=|x|$ ofc) as the left hand derivative and the right hand derivatives are different.

But then I know if $f(x)$ = $|x^3|$ at $x=0$ the left and the right hand derivative would be defined and equal, thus being defined for all x belonging to Real numbers. And moreover $x^3$ is inside the modulus ( which ummm… is not defined at $f(x)=0$ as modulus functions work that way ? ).

In short how can the statement written in my book be correct if $f(x)=|x^3|$ ?

Best Answer

The statement the book enunciates is completely wrong. The easiest counterexample for it would be any constant function $f:\mathbb{R}\to \mathbb{R}$. As you suggest, the function: $$f(x) = |x^3| = \begin{cases} x^3 & , x\geq 0 \\ - x^3 & , x<0 \end{cases} $$ , is both continuous and differentiable in the whole real axis.