TITLE: Derivative Greater Than 0 Implies One-To-One Function In Neighborhood
QUESTION [6 upvotes]: Let $f: \textrm{dom}(f) \rightarrow \mathbb{R}.$
Let $x_0 \in \mathbb{R}.$
Assume $f'(x_0) > 0$.
i.e. $~ \displaystyle\lim_{h \rightarrow 0} \frac{f(x_0 + h) - f(x_0)}{h} > 0$
i.e. $~ \exists l > 0 \textrm{ s.t. } \forall \varepsilon_1 > 0, \exists \delta_1 > 0 \textrm{ s.t. } \forall h \in \mathbb{R}, 0 < |h| < \delta_1 \Rightarrow \Bigg| \displaystyle\frac{f(x_0 + h) - f(x_0)}{h} - l \Bigg| < \varepsilon_1$
This implies that $f$ is continuous at $x_0$, as I have proven before.
i.e. $~ \forall \varepsilon_2 > 0, \exists \delta_2 > 0 \textrm{ s.t. } \forall x \in \mathbb{R}, |x - x_0| < \delta_2 \Rightarrow |f(x) - f(x_0)| < \varepsilon_2$
Also,
$\exists \delta_3 > 0 \textrm{ s.t. } \forall x \in \mathbb{R}, 0 < |x - x_0| < \delta_3 \Rightarrow \displaystyle\frac{f(x) - f(x_0)}{x - x_0} > 0$
I would like to prove there exists an open interval containing $x_0$ where $f(x)$ does not have a value of $f(x_0)$ for any $x$ in that interval apart from $x_0$.
i.e. $~ \exists a, b \in \mathbb{R} \textrm{ s.t. } a < x_0 < b \wedge \big( \forall x \in (a, b), x \neq x_0 \Rightarrow f(x) \neq f(x_0) \big)$
Unfortunately, I cannot say anything about double differentiability of $f$.
Because of this, I cannot mention continuity of $f$ in a neighborhood of $x_0$ (or can I?)
Perhaps there is a counterexample and I shouldn't try to prove this statement.
Help needed.

REPLY [6 votes]: 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.$