# Function that is continuous and monotone increasing but not differentiable at 0

Give an example of a function $f: (-1,1) \rightarrow \mathbb{R}$ which is continuous and monotone increasing, but which is not differentiable at 0. Explain why this does not contradict the fact that if a function is monotone increasing and differentiable at $x_0$ then $f'(x_0) \leq 0$.

My first thought was to use the function $f(x) = |x|$, however I don't believe this function is monotone increasing. Am I right?

• $|x|$ is not monotone increasing, you are correct. – Michael Burr May 5 '16 at 15:38
• Make your example monotone increasing by considering $$f(x)=|x|+2x.$$ – Did May 5 '16 at 21:13
• I can't propose an edit because it's too small, but shouldn't $f'(x_0) \geq 0$, rather than the other way around? – 4D enthusiast Dec 29 '16 at 10:54

Write $f(x)=x$ if $x\geq0$ and $f(x)=2x$ if $x<0$.

To make the second conclusion, you would need $f'$ to exist throught the open interval $(-1,1)$, which is obviously not true here.

• Does this still count even though these are two separate functions? – Ben May 5 '16 at 15:41
• or should I let $f$ be a piece wise function consisting of the functions you mentioned? – Ben May 5 '16 at 15:54
• I have defined $f$ piecewise. So, yes, define $f$ in this way. – Landon Carter May 5 '16 at 16:06
• Actually it would only be necessary for f' to exist at 0, not the whole interval. – 4D enthusiast Dec 29 '16 at 11:01
• +1 Your answer is perfectly fine and I don't know why it originally got no up votes (in my case, I mostly likely didn't see it). In fact, off-hand I can't think of a simpler example for just what was asked. – Dave L. Renfro Apr 5 at 13:34