# Pathological function needed

Give a differentiable function that has a positive derivative at $0$, yet is not increasing on any open neighbourhood of $0$.

I believe that the required function needs to have a derived function that is discontinuous at $0$ (ie. the required function needs to be not continuously differentiable at $0$). Any suggestion would be appreciated.

-
 Nice title! $\hskip4in$ – JavaMan Feb 12 at 1:38 Functions of the form $Ax^\alpha+Bx^\beta\sin(x^\gamma)$ are your friends for these types of problems. – David Mitra Feb 12 at 1:43

The function $f$ defined by $$f(x)=\cases{x+2x^2\sin(1/x),& x\ne0\cr 0, &x=0}$$ is differentiable, $f'(0)=1$, but $f'$ takes both positive and negative values in every neighborhood of $0$.
 Thanks! $f'(x)=1+4x\sin\frac1x-2\cos\frac1x$ in every punctured neighbourhood of $0$. How to show that this derived function takes both positive and negative values in every punctured neighbourhood of $0$ ? – Ryan Feb 12 at 2:53 @Ryan $f'(1/(k\pi) ) =1+0-2=-1$ if $k$ is even and $f'(1/(k\pi) ) =1+0+2=3$ if $k$ is odd. – David Mitra Feb 12 at 2:56 Brilliant! I don't know how I would've solved this problem on my own. Thank you. – Ryan Feb 12 at 3:01 @Ryan You're welcome. Glad to help. (I think you'd have eventually found it, using Ross' hint.) – David Mitra Feb 12 at 3:16 Insertion for super-explicitness: For each neighbourhood $N$ of $0$, there is some odd $k_1$ and some even $k_2$ such that $\frac 1{k_1\pi},\frac1{k_2\pi} \in N$. – Ryan Feb 12 at 3:30
 @Ryan Think about wiggling along the line $y=x$. – David Mitra Feb 12 at 1:55