If a differentiable real function has negative derivative when it intersects the x-axis, then it crosses the x-axis at most once? $\textbf{Question:}$ Let $f: \mathbf{R}\rightarrow \mathbf{R}$ be a differentiable real function. Suppose we know $f'(x) <0$ whenever $f(x)=0$. Prove that there is at most a unique $x$ such that $f(x)=0$.
To me, the claim seems very intuitive: if there are multiple, say two, intersections with the $x$-axis, $\underline{x}$ and $\overline{x}$, then there would be another point $x_1 \in (\underline{x}, \overline{x})$ such that $f(x_1)>0$, which would then lead to another point $x_2 \in (\underline{x}, x_1)$, such that $f(x_2)=0$ and $f'(x_2) >0$, a contradiction.
However, I have a hard time making these arguments formal. I tried intermediate value theorem and mean value theorem, but I couldn't get anywhere. Appreciate any help and guidance!
 A: If there are two such points, say $x_1$ and $x_2$, then you can apply the MVT across those two points, meaning that $\exists c \in (x_1, x_2)$ such that $f'(c) = \frac{f(x_2) - f(x_1)}{x_2 - x_1}$.
Is there a problem with that statement though?
A: If there are two points, $x_1\lt x_2$ where $f(x)=0, f'(x)\lt 0$, just above $x_1$ we have $f(x) \lt 0$ while just below $x_2$ we have $f(x) \gt 0$.  Then the intermediate value theorem tells you there is a point where $f(x)=0$ crossing from negative to positive, so $f'(x) \gt 0$, or staying at $0$ so $f'(x)=0$.  To justify the first point, use Taylor's theorem with the error term to show you can get close enough to the root for the first derivative to dominate any other term.
A: Let's suppose $f(a) =f(b) =0$ with $a<b$. Since $f'(a) <0$  there is an interval $(a, a+h]$ with $a+h<b$ where $f$ is negative. Let $c$ be first zero of $f$ in $[a+h, b] $.
We have thus found two consecutive roots $a, c$ of $f$ such that $a<c$ and $f$ does not vanish in $(a, c) $. By intermediate value theorem it maintains a constant sign there and is thus negative in $(a, c) $. But this clearly contradicts $f'(c) <0$ as $f'(c) <0$ implies an interval of type $[c-k, c) $ where $f$ is positive.
