Let X be a random variable with mean $\mu$ and continuous cumulative distribution function $F$. Show that
$$\int_{-\infty}^{a}F(x)dx = \int_{a}^{\infty}[1-F(x)]dx$$
if and only if $a = \mu$.
This question seems related, and I believe that changing the order of integration is involved but I haven't been able to work out the details.