How would you prove that if $x$ is an integer, then
$$x-\left\lfloor \frac{x}{2} \right\rfloor\; =\; \left\lfloor \frac{x+1}{2} \right\rfloor$$
I tried to start by saying that if $x$ is an even integer, then:
$$\left\lfloor \frac{x}{2} \right\rfloor = \frac{x}{2}.$$
However, I am stuck on showing that $$\left\lfloor \frac{x+1}{2} \right\rfloor$$ is also $\frac{x}{2}$. Intuitively It makes intuitive sense just by playing around with some sample numbers, but I don't know how to make it mathematically rigorous. Further, what do you do in the odd case? Is this even the right way to go about it?
If $x$ is even, then $x=2k$ where $k \in \mathbb{Z}$.
We then have: $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k-\lfloor k \rfloor=k=\left\lfloor k+\frac{1}{2} \right\rfloor=\left\lfloor \frac{2k+1}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$
If $x$ is odd, then $x=2k+1$ where $k \in \mathbb{Z}$.
We then have $$x-\left\lfloor \frac{x}{2} \right\rfloor=2k+1-\left\lfloor k+{1\over 2} \right\rfloor=k+1=\left\lfloor k+1 \right\rfloor=\left\lfloor \frac{2k+2}{2} \right\rfloor=\left\lfloor \frac{x+1}{2} \right\rfloor$$