L'Hospital rule (according to Rudin or this website):
Suppose that $f$ and $g$ are differentiable on the open interval $(a,b)$, that $\lim_{x\to a^+} f(x) = 0$, $\lim_{x\to a^+} g(x) = 0$, that $g'(x) \ne 0$ on $(a,b)$ and that $\lim_{x\to a^+} \frac{f'}{g'}$ exists. Then, $$\lim_{x\to a^+} \frac{f(x)}{g(x)} = \lim_{x\to a^+} \frac{f'(x)}{g'(x)}$$
Here is a proof (the proof given in the website):
Let $f(a)=g(a)=0$ Then $f,g$ are continuous on $[a,b)$. Let $x\in (a,b)$. $f,g$ are continuous on $[a,x]$ and differentiable on $(a,x)$. By the generalized MVT, we have: $$f(x) g'(c)= g(x) f'(c)$$ for a certain $c\in (a,x)$. Hence, $$\frac{f'(c)}{g'(c)} = \frac{f(x)}{g(x)} \tag{1}$$ We conclude by taking the limit as $x$ tends to $a^+$.
My question is: why does the statement of the theorem (be it from Rudin, on from the website) doesn't require $g(x)\ne 0$ on $(a,b)$ ? In $(1)$ we get to divide by $g(x)$.
Do we have the guarantee that the RHS denominator doesn't blow up when the LHS denominator is different from $0$ as in $(1)$ ?
Thank you.
Edit: From $(1)$ we have:
$$g(x) = \frac{g'(c)}{f'(c)} f(x)$$
However we don't have the guarantee that $f(x)/f'(c) \ne 0$
Derivatives have the intermediate value property, that is Darboux's theorem. So $g'(x) \ne 0 $ on $(a, b)$ implies that $g'$ is everywhere positive or everywhere negative in the interval, i.e. the function $g$ is strictly increasing or stricly decreasing.
Together with the fact that $\lim_{x \to a+} g(x) = 0$ it follows that $g$ is everywhere positive or everywhere negative in $(a, b)$.