Suppose that $f(x)$ and $g(x)$ are real-valued functions that are infinitely differentiable at the point $x=x_0$. Suppose that the limit $$ L_0=\lim_{x\to x_0} \frac{f(x)}{g(x)} $$ exists. Thus, if we consider the function, $$ r(x) = \frac{f(x)}{g(x)} $$ and define $r(x_0)=L_0$, we know that $r$ is continuous at $x=x_0$.
My question: can we say that $r(x)$ is infinitely differentiable (i.e. smooth) at $x=x_0$?
Please note that $g(x)$ (and its derivatives) could potentially vanish at $x=x_0$.
Motivation: I know that the result is true if you replace "smooth" by "real-analytic" everywhere in the above question. So it is natural to ask the analogous question for ratio of smooth functions.
P.S. I am tagging examples-counterexamples in case the question has a negative answer (in which case I would love to see a counter-example!).
Here is a counterexample. Let $$f(x)=\begin{cases} 0 &\text{if }x\leq 0 \\ xe^{-1/x^2} &\text{if }x> 0\end{cases}$$ and $$g(x)=\begin{cases} 0 &\text{if }x=0 \\ e^{-1/x^2} &\text{if }x\neq 0.\end{cases}$$ Then $f(x)$ and $g(x)$ are both smooth on all of $\mathbb{R}$, and $r(x)=f(x)/g(x)$ can be extended continuously to $0$ by defining $r(0)=0$. However, the resulting function $$r(x)=\begin{cases} 0 &\text{if }x\leq 0 \\ x &\text{if }x> 0\end{cases}$$ is not differentiable at $0$.
More generally, if you replace the factor of $x$ with $x^k$ for any $k\in\mathbb{N}$, then $r(x)$ would be $C^{k-1}$ but not $C^k$.