I am in High school in a book like baby rudin is completely out of my league. But in this question, a comment by
@YuiToCheng said "In order to apply L'hopital's rule, you only need to know $\lim \frac{f'(x)}{g'(x)}$ exists and $\lim g(x)=\infty$, see chapter 5 of baby rudin."
And, sure this is what the book says.
But being in high school I was only taught that to apply the L'hopital's rule. The condition required is $\lim g(x)=0 and \lim f(x)=0 $ and the function should be differentiable at that point. I was also taught that it was valued for $\frac{\infty}{\infty}$, but it was not mentioned taht it is valid for $\frac{anything}{\infty}$. The argument that my teacher made was that $\lim \frac{f(x)}{g(x)}= \lim \frac{\frac{1}{f(x)}}{\frac{1}{g(x)}}$ And as $\lim f(x) = 0 = \lim g(x) $ , $ \lim \frac{1}{f(x)} = \infty $, which makes it valid for $\frac{\infty}{\infty}$
Also I was taught that there is no need for the fact that $\lim \frac{f'(x)}{g'(x)}$ exists. Because if it doesn't and it is $\frac{0}{0} $ type, we can again apply the theorem. , that is just find $\lim \frac{f''(x)}{g''(x)}$
But baby rudin seems to contradict this.
So was I taught wrong ?? Or is it given wrong in the book ?? Please help.