Let $f$ be a twice-differentiable function of $\mathbb R$ with $f(0)=0$. Define $$g(x)=\begin{cases}\frac{f(x)}{x},&\text{$x\neq0$}\\f'(0),&x=0\end{cases}$$ Prove that $g$ is a differentiable function of $x \in \mathbb R$.
I tried using the difference quotient around $0$ to get
$$g'(x)=\lim_{\epsilon \rightarrow 0} \frac{g(\epsilon)-g(0)}{\epsilon}=\lim_{\epsilon \rightarrow 0} \left( \frac{f(\epsilon)}{\epsilon^2} - \frac{f'(0)}{\epsilon}\right)$$ but this doesn't seem to be of much use. Apparently the problem can be solved using Taylor series, but I fail to see how.
By Taylor's theorem: $$f(x)=f(0)+f'(0)x+f''(0)\frac{x^2}{2}+r(x)x^2$$ $$f(x)=f'(0)x+\frac{f''(0)}{2}x^2+r(x)x^2$$ So $$\frac{f(x)}{x}=f'(0)+\frac{f''(0)}{2}x+r(x)x$$ So $g$ is continuous at $0$. Let's calculate $g'(0)$: $$g'(0)=\lim_{h \to 0} \frac{g(h)-g(0)}{h}$$ $$g'(0)=\lim_{h \to 0} \frac{\frac{f''(0)}{2}h+r(h)h}{h}$$ $$g'(0)=\lim_{h \to 0} \frac{f''(0)}{2}+r(h)$$ $$g'(0)=\frac{f''(0)}{2}$$