Suppose $f'(x)$ exists for all $x\neq0$, and $\lim_{x\rightarrow0}f'(x)$ exists. Show that $f'(0)$ exists. Let $f\colon \mathbb{R}\rightarrow\mathbb{R}$ be a continuous function on $\mathbb{R}$. Suppose $f'(x)$ exists for all $x\neq0$, and $\lim_{x\rightarrow0}f'(x)$ exists. Show that $f'(0)$ exists.
I totally have no idea how to prove this, if by definition, we should start with
$$f'(0)=\lim_{x\rightarrow0}\frac{f(x)-f(0)}{x-0}$$
and show that this limit exists. But how can I evaluate the limit since the function is given in general.
 A: Let $b = \lim_{x \to 0} f'(x)$. After replacing $f(x)$ with $f(x) - bx$ if necessary, we may assume $b = 0$. 
Let $\varepsilon > 0$ be given. Then there is some $\delta > 0$ such that $|f'(x)| \leq \varepsilon$ for $x \in (0,\delta]$. It follows from the mean value theorem that for all $x \in [0,\delta]$, we have
$$|f(x) - f(0)| \leq \varepsilon x.$$
Thus $0<x<\delta$ implies $\left|\frac{f(x) - f(0)}{x}\right| \leq \varepsilon$, proving that $f_{+}'(0) = \lim_{x \to 0, x > 0} (f(x) - f(0))/x = 0$. The relation $f_{-}'(0) = 0$ can be proved similarly.
Note. The version of the mean value theorem used here is as follows. If $f$ is continuous on $[a,b]$ and differentiable on $(a,b)$ with $|f'(x)|\leq M$, then $|f(b) - f(a)| \leq M(b-a)$.
A: I'll show that both Left hand derivative and Right hand derivative exists and are both equal i.e. $$\lim_{h\to 0^+}\frac{f(h)-f(0)}{h}$$ and $$\lim_{h\to 0^-}\frac{f(h)-f(0)}{h}$$ exists and are equal.By L'Hopital's Rule $$\lim_{h\to 0^+}\frac{f(h)-f(0)}{h}=\lim_{h\to 0^+}\frac{f'(h)}{1}=\lim_{h\to 0}f'(h)$$ The other limit can be evaluated similarly it will be same. Thus $f'(0)$ exists.
