Let $f : I → R$ be a continuous function on a open interval which has a local extremum at some $c\in I$. If $f$ is differentiable at $c$ then $f'(c) = 0$.
Is the following proof valid?
We study the difference quotient of $f$ at $x_0$:
$$\frac {f(x)−f(c)}{x−c}$$
Since $f$ is differentiable, we know that its limit exists for $x → c$.
Since $f$ is continuous and has a local extremum at $c$ by assumption, we get:
$$f(x)−f(c) = 0 \;(\forall x \in I)$$
Thus, by the quotient rule for limits, we find:
$$f '(c) = \lim_{ x\to c} \,\frac {f(x)−f(c)}{x−c} = \lim_{ x \to c} (0) = 0$$
Just because $f$ is continuous and has a local extremum at $c$, does not imply that $$ f(x) - f(x) = 0\;\forall x \in I\,.$$ The latter would imply that $f(x) = f(c)$ for all $x \in I$, meaning that $f$ would be the constant function.
Assume $c$ is a local maximum. Then use the definition of a local maximum to show that $$ \frac{f(x) - f(c)}{x-c} \leq 0\,,$$ for $x \geq c$ and then pass to the limit. Similarly you can show the other inquality thus concluding that $f'(c)=0$.