I am completely at a loss as how to proceed. I can't use differentiability here.The question is
Let $K$ be a compact subset of $\mathbb{R}$ and $f:K\rightarrow K$ be a function satisfying the condition $|f(x)-f(y)|=|x-y|\ \ \ \ \ \forall \ x,y\in K$ . Show that $f$ is surjective.
Please help..