I saw a question which puzzled me earlier on this forum (I apologize, but I can't find the original discussion, it's buried a month or so back).

Find a Real --> Real function f which has the following properties:

f(0) = 0 ; f is differentiable at x = 0, and has f '(0) = 1.

and:

For any positive number a, f is NOT monotonically increasing over the interval (0,a).

Well, I just had an inspiration:

$\displaystyle f(x) = \begin{cases}x & for\ x\ irrational \\ x - \cfrac{1}{b} & for\ rational\ x\ where\ x= \cfrac{a}{b}\ in\ lowest\ terms\end{cases}

$

I think it's fairly easy to show that this function is NOT monotonically increasing over any interval (0,a). Just tell me, please: is this right? Am I right to assert that the derivative at 0 is 1?