Use sandwich theorem to find $\lim_{x \to 0} f(x)$, when $|f(x)-1| \le x^2$

My approach: Using the definition of absolute function we know that,

$$ 0 \le |f(x)-1| \le x^2$$

Applying $\displaystyle \lim_{x \to 0}$ on lower and upper bound, we get

$$ \lim_{x \to 0}\,(0)=0 \qquad\text{ and }\qquad \displaystyle \lim_{x \to 0} \, (x^2)=0$$

So, by sandwich theorem,

$$ \lim_{x \to 0} |f(x)-1|=0$$

Case I:

$$\lim_{x \to 0} f(x)-1=0$$

$$\implies \displaystyle \lim_{x \to 0} f(x)=1$$

Case II:

$$\displaystyle \lim_{x \to 0} 1-f(x)=0$$

$$\implies \displaystyle \lim_{x \to 0} f(x)=1$$

In either case, $\displaystyle \lim_{x \to 0} f(x)=1$.


This was a 5 mark question on a test and my calculus professor gave me 2 marks for this solution. He says that he deducted marks because I wrote $0 \le |f(x)-1| \le x^2$ instead of $-x^2 \le f(x)-1 \le x^2$ and then applying sandwich theorem.

How is my approach wrong? Will my approach yield a wrong answer in a different scenario? Please explain.


The solution is absolutely correct , no need to write $−x^2≤f(x)−1≤x^2$ because if $\lim_{x \to 0} |f(x)−1|=0$ then $\lim_{x \to 0} f(x)=1$ , there is no need to discuss the cases . There is a theorem that states , if $\lim_{x \to y} |g(x)|=0$ then $\lim_{x \to y} g(x)=0$