I am reading "Principles of Mathematical Analysis" by Walter Rudin.
Thank you Saaqib Mahmood.
I copied and pasted your text
Theorem 5.13 on p.109:
Suppose $f$ and $g$ are real and differentiable in $(a, b)$, and $g^\prime(x) \neq 0$ for all $x \in (a, b)$, where $-\infty \leq a < b \leq +\infty$. Suppose $$ \frac{f^\prime(x)}{g^\prime(x)} \to A \ \mbox{ as } \ x \to a. \tag{13} $$ If $$ f(x) \to 0 \ \mbox{ and } \ g(x) \to 0 \ \mbox{ as } \ x \to a, \tag{14} $$ or if $$ g(x) \to +\infty \ \mbox{ as } \ x \to a, \tag{15} $$ then $$ \frac{f(x)}{g(x)} \to A \ \mbox{ as } \ x \to a. \tag{16}$$ The analogous statement is of course also true if $x \to b$, or if $g(x) \to -\infty$ in (15). Let us note that we now use the limit concept in the extended sense of Definition 4.33.
Here is Definition 4.33:
Let $f$ be a real function defined on $E \subset \mathbb{R}$. We say that $$ f(t) \to A \ \mbox{ as } \ t \to x, $$ where $A$ and $x$ are in the extended real number system, if for every neighborhood $U$ of $A$ there is a neighborhood $V$ of $x$ such that $V \cap E$ is not empty, and such that $f(t) \in U$ for all $t \in V \cap E$, $t \neq x$.
And, here is Rudin's proof:
We first consider the case in which $-\infty \leq A < +\infty$. Choose a real number $q$ such that $A < q$, and then choose $r$ such that $A < r < q$. By (13) there is a point $c \in (a, b)$ such that $a < x < c$ implies $$ \frac{ f^\prime(x) }{ g^\prime(x) } < r. \tag{17} $$ If $a < x < y < c$, then Theorem 5.9 shows that there is a point $t \in (x, y)$ such that $$ \frac{ f(x)-f(y) }{ g(x)-g(y) } = \frac{f^\prime(t)}{g^\prime(t)} < r. \tag{18} $$ Suppose (14) holds. Letting $x \to a$ in (18), we see that $$ \frac{f(y)}{g(y)} \leq r < q \qquad \qquad \qquad (a < y < c) \tag{19} $$
Next, suppose (15) holds. Keeping $y$ fixed in (18), we can choos a point $c_1 \in (a, y)$ such that $g(x) > g(y)$ and $g(x) > 0$ if $a < x < c_1$. Multiplying (18) by $\left[ g(x)- g(y) \right]/g(x)$, we obtain $$ \frac{ f(x) }{ g(x) } < r - r \frac{ g(y) }{g(x)} + \frac{f(y)}{g(x)} \qquad \qquad \qquad (a < x < c_1). \tag{20}$$ If we let $x \to a$ in (20), (15) shows that there is a point $c_2 \in \left( a, c_1 \right)$ such that $$ \frac{ f(x) }{ g(x) } < q \qquad \qquad \qquad (a < x < c_2 ). \tag{21} $$
Summing up, (19) and (21) show that for any $q$, subject only to the condition $A < q$, there is a point $c_2$ such that $f(x)/g(x) < q$ if $a < x < c_2$.
In the same manner, if $-\infty < A \leq +\infty$, and $p$ is chosen so that $p < A$, we can find a point $c_3$ such that $$ p < \frac{ f(x) }{ g(x) } \qquad \qquad \qquad ( a< x < c_3), \tag{22} $$ and (16) follows from these two statements.
Rudin assumed that $g'(x) \neq 0$ for all $x \in (a, b)$ but didn't assume that $g(x) \neq 0$ for all $x \in (a, b)$.
If $g(y) = 0$ in (18) and (19), division by zero occurres.
By the way, if we write $$ \frac{f(x)}{g(x)} \to A \ \mbox{ as } \ x \to a,$$ do we assume implicitly that $g(x) \neq 0$ for all $x$ which is near $a$?
Then, we don't need to assume that $g'(x) \neq 0$ for all $x \in (a, b)$ and don't need to assume that $g(x) \neq 0$ for all $x \in (a, b)$.