Evaluate the limit: $$ \lim_{x\to 0}\frac{x-\tan x}{x^3} $$
I solved it like this,
$$ \lim_{x\to 0} \left({1\over x^2} - \frac{\tan x}{x^3}\right) =\lim_{x\to 0}\left({1\over x^2} - {\tan x\over x}\cdot {1\over x^2}\right) $$
Now using the property $$ \lim_{x\to 0} \frac{\tan x}{x}=1 $$
we have:
$$ \lim_{x \to 0} \left(\frac{1}{x^2} - \frac{1}{x^2}\right)=0 $$
Please explain my error! How can I avoid such errors? I have it's correct solution. All I want to know is what I did wrong here?
Note: English is my second language.

The explanation you're looking for is this. You are implicitly using the properties $\lim\limits (f+g)=\lim\limits(f)+\lim\limits(g)$ and $\lim\limits (fg)=\lim\limits(f)\lim\limits(g)$, but this is only true when all the limits in these equalities exist, (disclaimer: there are important assumptions that I'm not writing but that should accompany these properties). More specifically, what you did (implicitly) was: $$ \begin{align} \lim\limits_{x\to 0} \left({1\over x^2} - \frac{\tan x}{x^3}\right) &=\lim\limits_{x\to 0}\left({1\over x^2} - {\tan x\over x}\cdot {1\over x^2}\right)\\ &=\lim\limits_{x\to 0}\left({1\over x^2}\right) + \lim\limits_{x\to 0}\left(- {\tan x\over x}\cdot {1\over x^2}\right) \tag{Incorrect}\\ &=\lim\limits_{x\to 0}\left({1\over x^2}\right) - \lim\limits_{x\to 0}\left( {\tan x\over x}\right)\lim\limits_{x\to 0}\left({1\over x^2}\right) \tag{Incorrect}\\ &=\lim\limits_{x\to 0}\left({1\over x^2}\right) - \lim\limits_{x\to 0}\left({1\over x^2}\right) \tag{*}\\ &=\lim\limits_{x\to 0}\left({1\over x^2} - {1\over x^2}\right) \tag{Incorrect}\\ &=0 \tag{**} \end{align} $$
$(\text*)\text{ As correct as something meaningless can be}$
$(\text{**})\text{ Actually correct, but it's too late}$
You can't just replace the value of the limit inside without using the above reasoning or something else which will end up not working.