The problem:
Given $f: D \rightarrow \mathbb{R}$ a differentiable function on the interval $(a,b)$, and $g: D \rightarrow \mathbb{R}$ satisfying: $$g(x) = \begin{cases}\dfrac{f(x)-f(x_0)}{x-x_0} & \text{ if } x \in D \setminus\{x_0\} \\ \;\;\;\;\;f'(x_0) & \text{ if } x=x_0\end{cases}$$ , whereas $x_0 \in (a,b)$.
Decide whether the following propositions are equivalent:
$\text{i)} \; f'$ has a local extremum at $x_0$.
$\text{ii)} \; g$ has a local extremum at $x_0$.
$\;$
Note: The problem doesn't include whether $f$ is twice-differentiable at $x_0$ or on the interval $(a,b)$.
Consider on the interval $(-1, 1)$ the function $f(x) = Ax^2 + x^2 \sin(\frac{1}{x})$ (with $f(0)$ defined to be $0$ to fill in the hole).
For $A = 1$, $g$ has an extremum (namely $0$) at $x = 0$. But $f'$ does not.
The extremum of $g$ is weak, though: $g(x) = 0$ for values of $x$ arbitrarily near $0$.
But if you pick $A > 1$, then $g$ has a strict extremum.
BTW, this function is my go-to function for anything involving reasonable-sounding statements about derivatives. Hope it's of some service to you as well. (Spivak's Calculus goes into some detail about this and related functions for the beginner, although you're probably well past that or you wouldn't be asking this question.)