Discontinuities of the derivative of a differentiable function on closed interval

The theorem in question (Darboux's theorem) basically states that the conclusion of the intermediate value theorem holds for the derivative of an everywhere differentiable function, even if the derivative is discontinuous.

For a simple discontinuity of either kind, it is true that either $f'(x-) \ne f'(x)$ or $f'(x+) \ne f'(x)$.

To be specific, let us treat the case where $f'(x)<f'(x+)$. Let $\lambda\in(f'(x),f'(x+))$, and pick $y>x$ with $f'(z)>\lambda$ whenever $z\in(x,y]$. Thus $f'(x)<\lambda<f'(x+)$, and $f'(z)\ne\lambda$ for all $z\in[x,y]$, contradicting Darboux's theorem.

The case $f'(x)>f'(x+)$ is treated similarly (or replace $f$ by $-f$ and use the case already treated). The case $f'(x-) \ne f'(x)$ is also treated the same way (or replace $f(x)$ by $f(-x)$).

Edited to fix a flaw pointed out in the comments, no less than seven years later!