# Sign of differentiable function near critical point

Background : We know that Brownian path oscillates infinitely often changing signs in any neighbourhood of $0$. I was trying to understand if this property holds because that Brownian paths are not differentiable. So my question is as follows.

Question : If $f :\mathbb{R} \rightarrow \mathbb{R}$ is differentiable and $f'(x)=0$ for some $x$, does it mean there exists $\delta > 0$ such that $f(y) \geq 0 \quad \forall \; x\leq y \leq x+\delta$ or $f(y) \leq 0 \quad \forall \; x\leq y \leq x+\delta$

Attempt : I assumed the contrary that there exists sequences $(a_n)$ and $(b_n)$ such that $f(a_n) >0$ and $f(b_n) < 0$, $x-a_n < \frac{1}{n}$, $x-b_n < \frac{1}{n}$. But I could not get any contradiction following the lines.

It is highly appreciated if some one could or disprove my claim. Thanks

• $\sin \frac{1}{x}$ is not even continuous at $0$, but oscillates heavily in every punctured neighbourhood of $0$. How could you modify it to get a counterxample? Dec 22 '14 at 16:52
• Counterexample : $x^3 \sin(\frac{1}{x})$. Thanks! :) Dec 22 '14 at 17:02
• Care to write an answer to your question so it doesn't remain unanswered, or would you prefer somebody else to write an answer? Dec 22 '14 at 17:03
• Posted the answer. Thanks again! Dec 22 '14 at 17:05
• Then take $e^{-1/x^2}$ instead of $x^3$ as the factor, that makes it smooth. Dec 25 '14 at 2:45

As Daniel Fischer pointed out in the comments, the claim is false and a counter example is $f(x) = x^3\sin(\frac{1}{x})$.