For a continuous random variable $X$, I want to show that $E|X-m|$ is minimum implies $m$ is the median of the distribution. Assume that the distribution function is $F$ and the density function is $f$.
In this case, we basically need to minimize
$$\int_x |x-m|f(x)\,dx=\int_{x>m}(x-m)f(x)\,dx+\int_{x<m}(m-x)f(x)\,dx.$$
I am finally being left with $2mF(m)-m+E(X)-2\int_{x<m}xf(x)\,dx$. What does it mean to minimise this expression? Is there some way out?
Well, my intuition says that since I have to prove that $F(m)=0.5$, I somehow will need to show that $E|X-m|$ is minimised if $2mF(m)-m=0$ (as then I will get $F(m)=0.5$