Analysis question from a past exam paper Assume that $f \in C^1 [a,b].$ Prove that $$\forall \epsilon \  \exists \delta > 0 : \\
x, y \in [a,b] , |x-y| < \delta \implies \left\vert\frac{f(x)-f(y)}{x-y} - f'(x) \right\vert < \epsilon $$
I did he following proof and I wonder if its entirely correct as the question itself would have carried 10 % of a 2hr exam.
Edit: edited the proof to make $\delta$ independent of $x$
Let $x,y \in [a,b]$
Since $f'$ is continuous on a compact set, then its uniformly continuous.
Hence
$\forall x,y \in [a,b], |x-y| < \delta \implies |f'(y)-f'(x)| < \epsilon $
By MVT, since $f \in C^1 [a,b], \ \exists c \in (x,y) : f'(c) = \frac{f(x)-f(y)}{x-y}$ .
Thus in particular, $|x-c|<|x-y| < \delta \implies |f'(c)-f'(x)| < \epsilon $ and we're done.
 A: Your proof is not correct as $\delta$ depends on $x$ in contradiction with what is requested. You can proceed as follows.
Choose $\epsilon \gt 0$. According to Heine–Cantor theorem it exists $\delta \gt 0$ such that $\left\vert f^\prime(t) - f^\prime(x) \right\vert \lt \epsilon$ for $\vert t - x \vert \lt \delta$.
To get the conclusion, pickup $x,y$ with $\vert x - y \vert \lt \delta$. According to the mean value theorem, for $x \neq y$, it exists $t \in (x,y)$ such that
$$\frac{f(x)-f(y)}{x-y} = f^\prime(t). $$ You have $\vert t - x \vert \lt \delta$ and therefore
$$\left\vert\frac{f(x)-f(y)}{x-y} - f^\prime(x) \right\vert < \epsilon $$
A: I'll give a slightly different proof:
Define the function $g\colon[a,b]\times[a,b]\to\mathbb{R}$ by
$$
g(x,y)=
\begin{cases}
\frac{f(x)-f(y)}{x-y} & x\neq y\\
f'(x) & x=y.
\end{cases}
$$
Now $f\in C^1$ gives $g$ is continuous.  Since $[a,b]\times[a,b]$ is compact, we have $g$ continuous implies $g$ uniformly continuous (Heine-Cantor), i.e., for every $\epsilon>0$ there exists $\delta>0$ such that
$$
\max\{\lvert x-x'\rvert,\lvert y-y'\rvert\}<\delta\implies\lvert g(x,y) - g(x',y')\rvert<\epsilon\quad\forall x,y,x',y'\in[a,b]
$$
and our result follows from the case $x'=y'=x$.
