Can a function have a positive derivative at a point but not be increasing/decreasing around that point?

The function $f$ defined by $$ f(x) = \begin{cases} x^2 \sin\left(\frac1x\right) & x\neq 0, \\ 0 & x = 0 \end{cases} $$ has some interesting properties beyond the listed ones. One of these is, no matter how small a neighborhood around $0$ you take, there is always an interval in that neighborhood on which $f'(x) > \frac12$ and an interval on which on which $f'(x) < -\frac12.$

So let $g(x) = 3f(x) + x.$ Then we have $g'(0) = 1 > 0.$ Moreover, if $N$ is a neighborhood of $0$ (that is, $N$ is an interval centered at $0$), then

  • there is an interval within $N$ in which $g'(x) = 3f'(x) + 1 < 3 \left(-\frac12\right) + 1 = -\frac12,$ and therefore $g$ is decreasing in that interval and therefore not increasing in $N$;
  • and similarly there is an interval within $N$ in which $g'(x) > \frac12,$ so $g$ is increasing in that interval and not decreasing in $N$.

So $g(x) = 3f(x) + x$ is a function with the following properties:

  • $\operatorname{dom}(g) = \mathbb{R}$.
  • $g$ is continuous
  • $g'(0) > 0$.
  • $g$ does not have a local extremum at $0$.
  • There isn't an interval centered at $0$ on which $g$ is increasing.
  • There isn't an interval centered at $0$ on which $g$ is decreasing.

If you want all those properties to apply at $x=a$ for some fixed non-zero number $a$ instead of at $x=0,$ just replace $g$ by the function $h$ defined by $h(x) = g(x - a).$