Give an example of a continuous function $f: (-1, 1) \rightarrow \mathbb{R}$ which attains a maximum at 0, but is not differentiable at 0

354 Views Asked by At

I need a little help with this exercise:

Give an example of a continuous function $f: (-1, 1) \rightarrow \mathbb{R}$ which attains a maximum at 0, but is not differentiable at 0

I thought of the function $f(x) = -|x|$ for this.

Proof:
It clearly takes a maximum at 0, and by taking the left and right limits at 0, which are both 0, we can conclude that it is continuous in 0. By taking the difference quotients from the left and right, which are 1 and -1, it's clear that this function is not differentiable at 0.

Is this function a valid example? And is the proof I gave right?

Thanks in advance!

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, that's a good example.

Trivia: you could say "take a random continuous function" with its maximum in 0 as an answer too, because they are almost all non differentiable at 0 (or anywhere else)