Let $f:[-1,1]\to\mathbb R$ be $C^1$ class.
Define $g:[-1,1]\to\mathbb R$ by $$g(x)=\begin{cases}f(0) &\mathrm{if}\ x=0 \\ \frac{1}{x}\int_0^x f(t)dt &\mathrm{otherwise} \end{cases}$$
Then, show that $g$ is $C^1$.
If $x\neq 0$, $g$ is differentiable and $g'(x)=-\frac{1}{x^2}\int_0^x f(t)dt+\frac{1}{x}f(x)$ and this is continuous by Fundamental theorem of Calculus.
Thus what I have to show is $g'(0)$ exists and $\displaystyle\lim_{x\to 0}g'(x)=g'(0)$.
Expectation
Before calculating $g'(0)$, I expect $g'(0)$ is $\frac{f'(0)}{2}$ because if I assume $g'$ is continuous at $0$, i.e., $\displaystyle\lim_{x\to 0}g'(x)=g'(0)$, I have \begin{align} \lim_{x\to 0}g'(x) &=\lim_{x\to 0}\left[-\frac{1}{x^2}\int_0^x f(t)dt+\frac{1}{x}f(x)\right]\\ &\underset{\mathrm{l'Hôpital}}=\dfrac{f'(0)}{2}, \end{align} and thus $g'(0)=\dfrac{f'(0)}{2}$.
Anyway, I calculate $g'(0)$ by definition.
I have to evaluate $$\lim_{h\to 0}\frac{g(h)-g(0)}{h}.$$ For $h>0$, I have $$\dfrac{g(h)-g(0)}{h}=\dfrac{\tfrac{1}{h}\int_0^h [f(t)-f(0)] dt}{h}$$ From the mean value theorem for integral, there is $c_h\in(0,h)$ s.t. $$\frac{1}{h}\int_0^h[f(t)-f(0)]dt=f(c_h)-f(0)$$ Thus $$\dfrac{g(h)-g(0)}{h}=\dfrac{f(c_h)-f(0)}{h}=\dfrac{c_h}{h}\dfrac{f(c_h)-f(0)}{c_h}$$ I have $\displaystyle\lim_{h\to 0^+}\dfrac{f(c_h)-f(0)}{c_h}=f'(0)$, but what is $\displaystyle\lim_{h\to 0^+}\dfrac{c_h}{h}$ ?
By the expectation above, $\displaystyle\lim_{h\to 0^+}\dfrac{c_h}{h}$ seems to be $\frac{1}{2}$, but I don't know how I should conclude that.
Perhaps my solution doesn't work. Thanks for the help.
Your argument doesn't work because you don't have control over $\frac {c_h}h$. Use L'Hopital's Rule (and the definition of $f'(0)$)to show that $\frac 1{x^{2}} \int_0^{x}[f(t)-f(0)-tf'(0)] dt \to 0$. Separate the terms and you will see that $g'(0)=\frac {f'(0)} 2$.