I'm working on a question that states:
Consider a differentiable function $f:\mathbb{R}\to\mathbb{R}$. Furthermore consider the sequences $(x_n)_n$ and $(y_n)_n$ which both have limit $0$ and $x_n < y_n$ for all $n\in\mathbb{N}$. Is the following true?
$$\lim_{n\to\infty} \frac{f(y_n)-f(x_n)}{y_n-x_n} = f'(0). $$
If yes give a proof, if no give a counter example and find the extra requirements for it to be true.
I thought it was true and as a proof I did the following:
Given that $f$ is differentiable and that $x_n < y_n$, by the mean value theorem there exists a $c_n \in (x_n,y_n)$ such that
$$ \frac{f(y_n)-f(x_n)}{y_n-x_n} = f'(c_n). $$
As $x_n$ and $y_n$ both converge to $0$ we have that $c_n$ will also converge to $0$. Therefore, by taking the limit for $n$ to infinity we find that
$$\lim_{n\to\infty} \frac{f(y_n)-f(x_n)}{y_n-x_n} = \lim_{n\to\infty}f'(c_n) = f'(0). $$
At this point I realised that I had used the continuity of $f'$ which was not given in the question. I am now wondering if this is a necessary condition for the problem or if it can be solved without using the continuity of $f'$. If it is a necessary condition what is a suitable counter example where $f'$ isn't continuous? Any help is appreciated.