The convergence/divergence of $\lim_{x \to 0} \frac{\ln(1+f(x))}{f(x)}$ when $f(x) = \sin(1/x)x^2$ This question came up between me and my teacher when we discussed whether the following is true or not.
Given that $\lim_{x \to a} f(x) = 0,$ is it true that $\lim_{x \to a} \frac{\ln(1+f(x))}{f(x)} = 1?$
It is widely known (e.g., by L'Hopital's Rule) that
$$\lim_{x \to 0} \frac{\ln(1+x)} x = 1,$$
but we wanted to know if it could be generalized.
Now, there are some trivial counterexamples like $f(x)=0$ or any function where it’s flat around $0,$ but my teacher argued that it could be generalized.
So, I used $f(x)=\sin(1/x)x^2$ as a counterexample. I argued that this diverges since it is goes to $1$ for  most of the time, but there are values that are undefined, so it is divergent. But my teacher argues that it does indeed converge to $1.$
Can anyone solve this for us? Thanks.
 A: We will assume that $\lim_{x \to a} f(x) = 0.$ Let us investigate the quantity$$\lim_{x \to a} \frac{\ln(1 + f(x))}{f(x)}.$$ (1.) Given that $f(x)$ is differentiable on some open interval $(b, c)$ containing $a$ (except possibly at $x = a$) and $f'(x) \neq 0$ for all $b < x < c$ (except possibly at $x = a$), then by L'Hopital's Rule, $$\lim_{x \to a} \frac{\ln(1 + f(x))}{f(x)} = \lim_{x \to a} \frac{f'(x)}{(1 + f(x)) f'(x)} = \lim_{x \to a} \frac{1}{1 + f(x)} = 1.$$
Unfortunately, if $f(x)$ has infinitely many roots in a neighborhood of $a,$ then we cannot use this argument. Particularly, for the function $f(x) = x^2 \sin \bigl(\frac 1 x \bigr)$ and $a = 0,$ one can prove that $f'(x) = 2x \sin \bigl(\frac 1 x \bigr) - \cos \bigl(\frac 1 x \bigr)$ has infinitely many roots in a neighborhood of $a = 0.$
(2.) Considering that $-1 < f(x) \leq 1$ in a neighborhood of $a,$ we may use the power series expansion of $\ln(1 + x)$ to obtain the formal power series $$\ln(1 + f(x)) = f(x) - \frac{[f(x)]^2}{2} + \frac{[f(x)]^3}{3} - \frac{[f(x)]^4}{4} + \cdots,$$ from which it follows immediately that we have $$\frac{\ln(1 + f(x))}{f(x)} = 1 - \frac{f(x)}{2} + \frac{[f(x)]^2}{3} - \frac{[f(x)]^3}{4} + \cdots.$$ By hypothesis that $\lim_{x \to a} f(x) = 0,$ we conclude $$\lim_{x \to a} \frac{\ln(1 + f(x))}{f(x)} = \lim_{x \to a} \biggl(1 - \frac{f(x)}{2} + \frac{[f(x)]^2}{3} - \frac{[f(x)]^3}{4} + \cdots \biggr) = 1.$$
