Limit of $\left\lfloor x \left\lfloor \frac1x \right\rfloor \right\rfloor$, as $x$ goes to zero

If we look at $$f(x)=\lfloor \frac1x \lfloor x\rfloor\rfloor$$ Then for $n\in \Bbb{N}$ and $x\in(n,n+1)$ we have that $$\frac1x\lfloor x\rfloor=\frac{n}{x}<1$$ so $f(x)=0$ and for $x\in(-n-1,-n)$ we have that $$\frac1x\lfloor x\rfloor =\frac{-n-1}{x}>1$$ and that is also $<2$ so $f(x)=1$.

So you could make a mistake (like I did) by saying $$\lim_{x\to\infty}f(x)=0=\lim_{x\to0^+}f(\frac1x)\\\lim_{x\to-\infty}f(x)=1=\lim_{x\to0^-}f(\frac1x)$$ However the function is actually discontinuous at positive integers because $f(1)=f(2)=\cdots=f(n)=1$ even though $\lim_{x\to n}f(x) = 0$ the overall limit to infinity doesn't exist.

The function is continuous for $x<-1$ hence the limit for $-\infty$ is indeed $$\lim_{x\to-\infty}f(x)=1=\lim_{x\to0^-}f(\frac1x)$$


$\lim\limits_{x\to 0^-}\left\lfloor x \left\lfloor \frac1x \right\rfloor \right\rfloor$ is indeed equal to $1$.

But $\lim\limits_{x\to 0^+}\left\lfloor x \left\lfloor \frac1x \right\rfloor \right\rfloor$ doesn't exist, because when $x=1/n$ for some positive integer $n$, then $\left\lfloor x \left\lfloor \frac1x \right\rfloor \right\rfloor$ is equal to $1$, not $0$.