TITLE: If $\lim_{x \rightarrow 0}\frac{f(x)}{x^2} = 5$, then what is $\lim_{x \rightarrow 0}f(x)$?
QUESTION [7 upvotes]: I know the answer to the above question, but I have a question on some of the reasoning.
The way I know how to solve it is $$\lim_{x \rightarrow 0}f(x) = \lim_{x \rightarrow 0}\left(f(x)\cdot \frac{x^2}{x^2}\right) = \lim_{x \rightarrow 0}\left(\frac{f(x)}{x^2}\cdot x^2\right) = \left(\lim_{x \rightarrow 0}\frac{f(x)}{x^2}\right)\left(\lim_{x \rightarrow 0}x^2\right) = 5\cdot0 = 0.$$
I saw another solution elsewhere that gets the right answer, but I am unsure if the steps are actually correct.
\begin{align*}
&\lim_{x \rightarrow 0}\frac{f(x)}{x^2} = 5 \\
\Longrightarrow &\frac{\lim_{x \rightarrow 0}f(x)}{\lim_{x \rightarrow 0}x^2} = 5 \\ 
\Longrightarrow &\lim_{x \rightarrow 0}f(x) = 5\cdot \lim_{x \rightarrow 0}x^2\\ \Longrightarrow &\lim_{x \rightarrow 0}f(x) = 5\cdot 0 = 0.
\end{align*}
My issue is with that first step. I know that $\lim_{x \rightarrow a} \frac{f(x)}{g(x)} = \frac{\lim_{x \rightarrow a}f(x)}{\lim_{x \rightarrow a}g(x)}$, but only when $\lim_{x \rightarrow a}g(x) \neq 0$. Since $\lim_{x \rightarrow 0}x^2 = 0$, wouldn't this invalidate the above work? However, it still got the same answer, so my real question is why did it work and when will it work in general?
EDIT: Does anyone have a nice example for when the logic in the second method doesn't work?

REPLY [2 votes]: $$\frac{\lim_{x \rightarrow 0}f(x)}{\lim_{x \rightarrow 0}x^2} = 5$$ doesn't work, the LHS is not defined.

But for the limit of $\dfrac{f(x)}{x^2}$ to exist, $\lim_{x\to0}f(x)$ must be zero, which is also the limit of $x^2$.

REPLY [2 votes]: If $\lim\limits_{x\to0}\dfrac{f(x)}{x^2}=5$, then for every $n\in\Bbb N$ there is some $x\neq 0$ such that
$$5-\frac1n<\frac{f(x)}{x^2}<5+\frac1n$$
and hence
$$5x^2-\frac{x^2}n<f(x)<5x^2+\frac{x^2}n$$
If $x\to 0$ we get $f(x)\to 0$.