Let $f: [0,1] \rightarrow \mathbb{R}$ be a $C^1$ function. By the mean value theorem, we have, for every $x,y \in [0,1]$ the following inequality
$$|f(x) - f(y)| \leq \max_{0\leq z \leq 1}|f'(z)||x-y|\ .$$
Is it true that, if we have $x < y \in [0,1]$ such that equality holds, then $$f'(\xi) = \max_{x\leq z \leq y}|f'(z)|, \quad \forall \xi \in [x,y] \ ,$$
that is, $f'$ is constant on $[x,y] \subset [0,1]$?
You can use Taylor-integral formula : $f(y)=f(x)+\int_x^y f'(t)dt$
Now let's call $M=\max\limits_{x\le z\le y}|f'(z)|$ and suppose we have $\frac{f(y)-f(x)}{y-x}=M$ for some $x,y$.
Then we have $0=f(y)-f(x)-\int_x^y f'(t)dt=M(y-x)-\int_x^y f'(t)dt=\int_x^y \big(M-f'(t)\big)dt$
But $M-f'(t)\ge 0$ for any $t\in[x,y]$ by definition of $M$.
We conclude that the integral can be null only if $f'(t)=M$ almost everywhere on $[x,y]$ (i.e. $\forall t\in[x,y]\setminus A$ where $\mu(A)=0$)
But you stated that $f$ is $C^1$ so by continuity $f'$ is constant on whole $[x,y]$.