Since $f$ and $g$ are both differentiable at $x=0$, $f(x) \rightarrow f(0)=0$ and $g(x) \rightarrow g(0)=0$ as $x\rightarrow 0$. Therefore, you can use L'Hopital to see that
$$
\lim_{x\rightarrow 0} \frac{f(x)}{g(x)} = \lim_{x\rightarrow 0} \frac{f'(x)}{g'(x)}.
$$
On the other hand,
$$
\lim_{x\rightarrow 0} \frac{f(x)}{g(x)} = \lim_{x\rightarrow 0} \dfrac{\frac{f(x)-f(0)}{x-0}}{\frac{g(x)-g(0)}{x-0}}=\dfrac{\displaystyle\lim_{x\rightarrow 0} \frac{f(x)-f(0)}{x-0}}{\displaystyle\lim_{x\rightarrow 0} \frac{g(x)-g(0)}{x-0}}=\frac{f'(0)}{g'(0)},
$$
where you can take the limit 'inside' the fraction because $f'(0)$ and $g'(0)$ exist and $g'(0)\neq 0$. Therefore, it must happen that
$$
\lim_{x\rightarrow 0} \frac{f'(x)}{g'(x)} = \frac{f'(0)}{g'(0)}.
$$
Edit (without using L'Hopital):
By the Mean Value Theorem, one can prove that $g(x)\neq 0$ for $x\neq 0$. By the same theorem, for each $x$ near $0$, we can find a real number $y$ between $0$ and $x$ such that
$$
\frac{f(x)}{g(x)} = \frac{f(x)-f(0)}{g(x)-g(0)}=\frac{f'(y)}{g'(y)}.
$$
Since $\displaystyle\lim_{y\rightarrow 0} \frac{f'(y)}{g'(y)}$ exists, we can conclude that
$$
\lim_{x\rightarrow 0} \frac{f(x)}{g(x)} = \lim_{x\rightarrow 0} \frac{f'(x)}{g'(x)}.
$$