I saw that the function $f(x) = {x \over 2} + x^2 \,\text{sin}({1 \over x})$, with $f(0)$ defined as $0$, was used as an example to show that even though a function is differentiable and the derivative is positive at the origin, the function is not monotonically increasing in any neighborhood of the origin.
But the function looks to me close enough to a linear function with slope $1/2$ (this is apparent if one plots it on a computer and zooms into a sufficiently small neighborhood of $0$). I don't mean it's a line in the neighborhood, I know it oscillates, all the way towards 0.
Figure: almost like a line with 1/2 slope
My question: for a function $f$ differentiable at point $p$, "on average" must $f$ approach a linear function represented by $f'(p)$? It seems plausible, as $f$ is continuous at $p$. If true, please explain; if false, please provide a counter example. Thank you!
Update: My confusion was resolved by Ian in the comments. The key is $f(x) - f(p) = f'(p)(x-p) + o(x-p)$.