Calculate the limit of the given function at $x=0$ Let $f(x)=x{\times}(-1)^{\left \lfloor \frac1x \right \rfloor}$. Calculate its limit at $x=0$. According to me the limit doesn't exist because if I take log on both sides of the equation, I get:-
$$\ln f(x) = \ln x+\left \lfloor \frac1x \right \rfloor {\times} \ln(-1)$$
Here $\ln(-1)$ doesn't exist and hence no limit should exist. 

Note that $\left\lfloor \dfrac1x \right\rfloor$ denotes the greatest integer less than or equals $\dfrac1x$. Hence, $(-1)^{\left\lfloor \dfrac1x \right\rfloor}$ makes sense since the power is always an integer. All you need for this proof is that $(-1)^{\left\lfloor \dfrac1x \right\rfloor}$ is either $1$ or $-1$. Hence, we have that $$-x \leq x \times  (-1)^{\left\lfloor \dfrac1x \right\rfloor} \leq x$$
Hence, as $x \to 0$, we have that $$\lim_{x \to 0}-x \leq \lim_{x \to 0} x \times  (-1)^{\left\lfloor \dfrac1x \right\rfloor} \leq \lim_{x \to 0} x$$
Hence, $$\lim_{x \to 0} x \times  (-1)^{\left\lfloor \dfrac1x \right\rfloor} = 0$$
EDIT
Note that $\log(a^b) = b \log(a)$ is valid only when $a>0$ and $x \in \mathbb{R}$. Hence, it is incorrect to write $\log((-1)^b) = b \log(-1)$.
