$\left\lfloor \frac{a-b}{2} \right\rfloor + \left\lceil \frac{a+b}{2} \right\rceil = a$ when $a,b$ are integers? Let $a$ and $b$ be positive integers.
If $b$ is even, then we have $$\left\lfloor \frac{a-b}{2} \right\rfloor + \left\lceil \frac{a+b}{2} \right\rceil = a$$
I think the equality also hold when $b$ is odd. What could be a proof for it?
 A: The equality only depends on the parity of $a+b$, as it is the same as that of $a-b$. Then
$$\left\lfloor\frac02\right\rfloor+\left\lceil\frac02\right\rceil=0$$
and
$$\left\lfloor\frac12\right\rfloor+\left\lceil\frac12\right\rceil=1$$
are enough as a proof.
A: This actually works whatever the value of $b$ -- it doesn't need to be an integer. Clearly it's true when $b=0$. Now imagine changing $b$ smoothly from $0$ to its final value. When does the value of our expression change? Precisely when $(a+b)/2$ or $(a-b)/2$ passes an integer; that is, when $a\pm b$ is an even integer; that is, when $b$ differs from $a$ by an even integer. When this happens, both terms change in opposite ways, so the expression as a whole doesn't change its value. So by the time $b$ reaches its final value, our expression still hasn't changed.
(On the other hand, if $a$ isn't an integer then the equation never holds because one side is an integer and the other isn't.)
A: If $a$ and $b$ are both odd then we have $a=2m+1$ and $b=2n+1$ where $m$ and $n$ are positive integers.
Then, we have \begin{align}\left\lfloor\frac{a-b}2\right\rfloor+\left\lceil\frac{a+b}2\right\rceil &= \left\lfloor\frac{(2m+1)-(2n+1)}2\right\rfloor+ \left\lceil\frac{(2m+1)+(2n+1)}2\right\rceil\\
&=\left\lfloor\frac{2m-2n}2\right\rfloor+ \left\lceil\frac{2m+2n+2}2\right\rceil\\
&=\lfloor m-n\rfloor + \lceil m+n+1\rceil\\
&= m-n + m+n+1\tag{$*$}\\
&= 2m+1\\
&=a\end{align}
We can get to $(*)$ because $m$ and $n$ are integers and so their floor (or ceiling) is just the number inside (two integers added or subtracted will always give an integer answer).
If $a$ is even and $b$ is odd, then we have $a=2m$ and $b=2n+1$, again for $m$ and $n$ integers.
So we have \begin{align}\left\lfloor\frac{a-b}2\right\rfloor+\left\lceil\frac{a+b}2\right\rceil &= \left\lfloor\frac{(2m)-(2n+1)}2\right\rfloor+ \left\lceil\frac{(2m)+(2n+1)}2\right\rceil\\
&=\left\lfloor\frac{2m-2n-1}2\right\rfloor+ \left\lceil\frac{2m+2n+1}2\right\rceil\\
&=\left\lfloor m-n-\frac 12\right\rfloor + \left\lceil m+n+\frac12\right\rceil\\
&= m-n -1+ m+n+1\tag{$\dagger$}\\
&= 2m\\
&=a\end{align}
Here we get to $(\dagger)$ because we round the first half down and the second half up to their respective nearest integers
A: As $s:=a+b$ and $a-b$ have the same parity, we can write
$$\left\lfloor\frac{s-2b}2\right\rfloor+\left\lceil\frac s2\right\rceil=\left\lfloor\frac s2\right\rfloor+\left\lceil\frac s2\right\rceil-b=s-b=a.$$
A: If $a$ and $b$ are both odd (or both even), then $a-b$ and $a+b$ are both even, and thus $$\left\lfloor \frac{a-b}{2} \right\rfloor = \frac{a-b}{2} \quad\text{and}\quad \left\lceil \frac{a+b}{2} \right\rceil = \frac{a+b}{2}.$$
Otherwise, if exactly one of $a$ and $b$ is odd, then $a-b$ and $a+b$ are both odd, and thus $$\left\lfloor \frac{a-b}{2} \right\rfloor = \frac{a-b}{2} - \frac12 \quad\text{and}\quad \left\lceil \frac{a+b}{2} \right\rceil = \frac{a+b}{2} + \frac12.$$
In either case, it's easy to check that your equation holds.

BTW, as noted by Gareth McCaughan, your equation in fact holds for all real numbers $b$, as long as $a$ is an integer.  One fairly simple way to show this is to note that $\frac{a+b}{2} = a - \frac{a-b}{2}.$  Thus, we can rewrite your equation as $$\left\lfloor \frac{a-b}{2} \right\rfloor + \left\lceil a - \frac{a-b}{2} \right\rceil = a.$$
Since $a$ is an integer (by assumption), and since $\lceil k + x \rceil = k + \lceil x \rceil$ for any integer $k$, we can extract $a$ from the ceiling term to get $$\left\lfloor \frac{a-b}{2} \right\rfloor + a + \left\lceil - \frac{a-b}{2} \right\rceil = a,$$ and finally, by applying the identity $\lceil -x \rceil = - \lfloor x \rfloor$, rewrite this as $$\left\lfloor \frac{a-b}{2} \right\rfloor + a - \left\lfloor \frac{a-b}{2} \right\rfloor = a.$$  Cancelling the floor terms then just leaves the identity $a = a$.
On the other hand, as also noted by Gareth, your equation cannot hold for any non-integer $a$, since its left-hand side is always an integer.
