# Left-hand limit and Right-hand limit of a function

There is a function given by $$f(x)=\begin{cases} x\sin{\frac{1}{x}}, & x \ne 0 \\ 0, & x=0. \end{cases}$$ Find the left-hand limit and right-hand limit and the continuity of this function at $$x=0$$.

This is what I tried:

(Left-hand limit at $$x=0$$) =$$\lim_{x\to 0^-}f(x)=\lim_{h\to 0} f(0-h)$$ $$\lim_{h\to 0} f(-h)=\lim_{h\to 0} (-h)\sin(\frac{1}{-h})$$ $$\lim_{h\to 0}(-h)\cdot\frac{1}{-h}\frac{\sin(\frac{1}{-h})}{\frac{1}{-h}}=1$$ I did this same process for the right hand limit at $$x=0$$ and also got $$1$$.

However, the book I got this from puts the working as such...

(Left-hand limit at $$x=0$$) =$$\lim_{x\to 0^-}f(x)=\lim_{h\to 0} f(0-h)$$ $$\lim_{h\to 0} f(-h)=\lim_{h\to 0} (-h)\sin(\frac{1}{-h})=\lim_{h\to 0} h\cdot\sin(\frac{1}{h})$$ $$0\times(\text{ an oscillating number between -1 and 1}) = 0$$ The same was done for the right-hand limit and it was concluded that $$f(x)$$ is continuous at $$x=0$$ and the value of its limit is $$0$$.

I know that the graph of the function gives $$0$$ at $$x=0$$. But I don't understand whats wrong with my working. Please explain

You have $$\frac{\sin(x)}{x}\to 1$$ when $$x\to 0$$.
Here, however, you're trying to use it when $$x$$ is $$\frac{1}{-h}$$, which goes to $$-\infty$$ rather than (as $$h$$ itself does) to $$0$$.
What your calculation does show is that $$\lim_{x\to \pm\infty} f(x) =1$$ Bur that was not the limit you set out to find.