# continuity of floor function in $\mathbb Z$

Suppose $$f(x)=\left|x-2\left\lfloor\frac{x+1}{2}\right\rfloor\right|$$ To prove the continuity of $f$ in $\mathbb {R}$ we have to prove it first in $\mathbb {Z}$ then at $\mathbb{R} - \mathbb{Z}$. But why do we have to prove the continuity if $x=2n$ and $x=2n-1$ ($n \in \mathbb {N}$ odd or even) when we want to prove the continuity in $\mathbb {Z}$? (I saw this in a solution but I didn't understand it)

-