Suppose that for $y \in (x,x+h)$,
$$k < \frac{f(x+h)-f(x)}{h} < \frac{f(y)-f(x)}{y-x}$$
We then have for $\delta > 0$,
$$\frac{f(x+h)-f(x)}{h} \leqslant \sup_{y \in (x,x+\delta)}\frac{f(y)-f(x)}{y-x} \\\ \implies\frac{f(x+h)-f(x)}{h} \leqslant \lim_{\delta \to 0+}\sup_{y \in (x,x+\delta)}\frac{f(y)-f(x)}{y-x} = \limsup_{y \to x+} \frac{f(y)-f(x)}{y-x}, $$
leading to a contradiction
$$k < \limsup_{y \to x+}\frac{f(y)-f(x)}{y-x}= D^+f(x) \leqslant k$$