Question: How can I prove that, for $a,b \in \mathbb{Z}$ we have $$ 0 \leq \left \lfloor{\frac{2a}{b}}\right \rfloor - 2 \left \lfloor{\frac{a}{b}}\right \rfloor \leq 1 \, ? $$ Here, $\left \lfloor\,\right \rfloor$ is the [floor](http://mathworld.wolfram.com/FloorFunction.html) function. I tried the following: say that $\frac{2a}{b} = x$, and $ \left \lfloor{\frac{2a}{b}}\right \rfloor = m$, with $0 \leq x - m \leq 1$. I tried the same for $ 2 \left \lfloor{\frac{2a}{b}}\right \rfloor $, and then combining the two inequalities. It did not seem to help, though.

Answer: 
In general
$$
0\le \lfloor 2x\rfloor -2\lfloor x\rfloor\le 1.
$$
Proof. Either $x\in [k,k+1/2)$ or $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$.

If $x\in [k,k+1/2)$, then
$$
 \lfloor 2x\rfloor=2k\quad\text{and}\quad 2\lfloor x\rfloor=2k,
$$
while $x\in [k+1/2,k+1)$, for some $k\in\mathbb Z$, then
$$
\lfloor 2x\rfloor=2k+1\quad\text{and}\quad 2\lfloor x\rfloor=2k.
$$
So the inequalities hold in both cases.
Hint: let $a=pb+q$ where $p, q \in \mathbb Z$ and $0\le q<b$.