Let $x_1, x_2, . . , x_n$ real numbers from $[0, 1]$. Prove there is $x \in [0, 1]$ so that $|x - x_1| + |x - x_2| + . . . + |x - x_n| =\frac n 2$
My attempt
Let $f:[0,1] \rightarrow R, f(x)=|x - x_1| + |x - x_2| + . . . + |x - x_n|$. Because $f$ continous, the image of $f$ is an interval. To prove $\exists x \in [0,1]$ so that $f(x)=\frac n 2$ it is enough to find two values $a,b \in [0,1]$ so that $f(a) \le \frac n 2 \le f(b)$. I failed to find these values.
Also, a solution without function continuity will be appreciated.