# One-sided limit in relation to a floor-function

I'm having problem understanding if the following statement is true or false (prove or provide a counter example):

if $\lim_{x\to x_0+} f(x) = L$, then $\lim_{x\to x_0+} \lfloor{f(x)}\rfloor = \lfloor{L}\rfloor$ or $\lim_{x\to x_0+} \lfloor{f(x)}\rfloor = \lfloor{L}\rfloor - 1$

By intuition it seems true. However I'm clueless on either proving it or on the other hand providing a counter example.

• It's not true but I am having trouble defining the counterexample. The issue is that even though we are approaching $x_0$ from the positive side, the limit $L$ might be approached by $f$ from both sides, and the floor will cause it to alternate between two integers. – Tony S.F. Jan 30 '18 at 13:03

$$f(x) = \begin{cases} 1+x & x\in\mathbb{Q},\\ 1-x, &x\not\in\mathbb{Q}\end{cases}$$
Then, $\lim\limits_{x\rightarrow0^+} f(x) = 1$ but $\lim\limits_{x\rightarrow 0^+}\lfloor f(x)\rfloor$ doesn't exist since $\lim\limits_{x\rightarrow 0^+, x\in\mathbb{Q}}\lfloor f(x)\rfloor=1$ but $\lim\limits_{x\rightarrow 0^+, x\not\in\mathbb{Q}}\lfloor f(x)\rfloor=0$
• Your function is nowhere continuous except at $x=0$. The other two answers here are everywhere continuous except at $x=0$. – Parcly Taxel Jan 30 '18 at 13:21
Consider $$\lim_{x\to0+}x\sin\frac1x=0.$$ You have $$\left\lfloor x\sin\frac1x\right\rfloor=\begin {cases}0,&\ \frac1 { (2k+1)\pi}\leq x\leq\frac 1 {2k\pi}\\ \ \\-1,&\ \text {otherwise}\end {cases}$$ So the limit of the floor of the function doesn't exist.