Derivative Greater Than 0 Implies One-To-One Function In Neighborhood

It is not true that if $f'(x_0)>0$ then $f$ is one-to-one in some open neighborhood of $x_0.$

But it is true that if $f'(x_0)>0$ then there is some open neighborhood of $x_0$ within which $f$ takes the value $f(x_0)$ only at $x_0$ and nowhere else.

Let $\displaystyle f(x) = \begin{cases} f(x_0) & \text{if }x=x_0, \\[8pt] f(x_0) + (x-x_0) + (x-x_0)^2 \sin(1/(x-x_0)) & \text{if } x\ne x_0. \end{cases}$

Then $f'(x_0)=1,$ but in every open neighborhood of $x_0$ there are values of $x$ for which $f'(x)$ is positive and others for which it is negative. Thus $f$ is not one-to-one in that neighborhood.

However, there is some open neighborhood of $x_0$ within which every value of $x$ other than $x_0$ satisfies $$ \frac{f(x) - f(x_0)}{x-x_0} > \frac 1 2. $$ That implies $f(x)-f(x_0)>0$ if $x>x_0$ and $f(x)-f(x_0)<0$ if $x<x_0.$


Consider the function $$ f(x) = \begin{cases} x + x^2 & {\rm if \ } x \in \{\tfrac 1 2, \tfrac 1 4, \tfrac 1 8 , \tfrac 1 {16}, \dots \} \\ x & {\rm otherwise \ }\end{cases}$$

$f$ is differentiable at $x = 0$, with derivative $f'(0) = 1$.

But for every $\delta > 0$, there exists an $n$ such that $\left|\tfrac 1 {2^n} \right| < \delta$ and $\left| \frac 1 {2^n} + \frac 1 {4^n}\right| < \delta$.

Since $$f(\tfrac 1 {2^n}) = f(\tfrac 1 {2^n} + \tfrac 1 {4^n}) = \tfrac 1 {2^n} + \tfrac 1 {4^n},$$ $f$ is not injective on $(-\delta, \delta)$.