Some confusion about the proof for Darboux's Theorem I'm having some confusion in the proof of Darboux's Theorem. It appears similar questions have been asked before, but I'm still confused by the replies, so I thought I would ask my own.
Here is my proof.
Let $g(x) = f(x) - \gamma x$
Assume $f'(a) < f'(b)$ w.l.o.g.
We know
$f'(a) < \gamma < f'(b)$ by hypothesis.
So,
$f'(a) - \gamma = g'(a) < 0$ and $f'(b) - \gamma = g'(b) > 0$
Since
$g'(a) < 0$ and $g'(b) > 0$, (opposite signs) we know $\exists c$ such that $g'(c) = 0$
That step right there is my confusion. I am basically using the IVT to claim there is a value in between. However, to use the IVT, the function has to be continuous. That is not an assumption in the problem, only that $f$ is continuous. I've found this question asked a couple of times, but the common reply seems to be that the derivative need not be continuous to have the intermediate value property because of Darboux's Theorem. But I am trying to prove Darboux's Theorem! So while I believe that fact, I can't use the theorem within its proof. I cannot seem to justify that step in the event that $g'$ is discontinuous.
I have been told there is another version of the proof combining the MVT and IVT. However, I've found it online in a few places, and I'm having a hard time following it. So I am trying to figure out how to do it this way since I don't understand the other way. Can someone explain to me why I can use the IVT without the derivative being continnuous?
 A: Since $g'(a)<0$, $g(x)<g(a)$ when $x>a$ and $x$ is close enough to $a$. And, since $g'(b)>0$, $g(x)<g(b)$ when $x<b$ and $x$ is close enough to $b$. So, $g$ has a minimum on $[a,b]$ which is attained at some $x_0\in(a,b)$. And so $g'(x_0)=0$, since:

*

*if $x>x_0$, then $\frac{g(x)-g(x_0)}{x-x_0}\geqslant0$, and therefore $g'(x_0)=\lim_{x\to x_0^{\,+}}\frac{g(x)-g(x_0)}{x-x_0}\geqslant0$;

*if $x<x_0$, then $\frac{g(x)-g(x_0)}{x-x_0}\leqslant0$, and therefore $g'(x_0)=\lim_{x\to x_0^{\,-}}\frac{g(x)-g(x_0)}{x-x_0}\leqslant0$.

And $g'(x_0)=0\iff f'(x_0)=\gamma$.
A: The function $g\colon [a,b]\to\Bbb R$ is continuous, hence attains its minimum at some $x_0\in [a,b]$.

*

*We have $g'(x_0)\ge 0$: This is clear if $x_0=b$, so assume $x_0<b$. Then for all sufficiently small $h>0$, we have $x_0+h\le b$ and $g(x_0+h)\ge g(x_0)$, hence $\frac{g(x_0+h)-g(x_0)}{h}\ge 0$. By taking the limit as $h\to 0^+$, we find $g'(x_0)\ge 0$.


*We have $g'(x_0)\le 0$: This is clear if $x_0=a$, so assume $x_0>a$. Then for all sufficiently small $h>0$, we have $x_0-h\ge h$ and $g(x_0-h)\ge g(x_0)$, hence $\frac{g(x_0-h)-g(x_0)}{-h}\le 0$. By taking the limit as $h\to 0^+$, we find $g'(x_0)\le 0$.
Therefore $g'(x_0)=0$.
