Proving that median of list $[x_1,x_2,...,x_n]$ minimises the sum $\sum_{i=1}^{i=n} |x_i-m|$ where $m$ is some number The problem is in the title. Here is a detailed description:
Let's say we have list $[x_i]_{i=1}^{i=n}$ where $x_i\in\Bbb{N}$. I want to pick such $m\in\Bbb{N}$ which minimises the sum $\sum_{i=1}^{i=n} |x_i-m|$.
In my computer science class we had a problem which was equivalent to the upper one. And apparently the answer was that the $m$ we should choose is the median of the list. But no one has proven it, and I have a hard time seeing why that is the case and not for example arithmetic mean of the list. 
What strategy should I use in order to prove that? 

Note that the function is differentiable at most points.  Calculate its derivative at the points of differentiability and observe that the derivative is always an integer.  Then figure out where it is zero. 
