TITLE: Prove expansive function on a compact set is surjective.
QUESTION [6 upvotes]: Let $M$ be a compact set and $(M,d)$ be a metric space, define function $f:M\to M$ such that for all $\,p,q\in M$ $$d(f(p),f(q))\ge d(p,q)$$
  Prove $f$ is surjective.

I observed that compactness of $M$ is crucial, supposing $M$ being only closed or bounded would have counterexamples of $f$.
Also I found another problem which might be related somehow, I couldn't help this but guessing we have to prove $f$ is isometric.

@TommasoSeneci Thank you very much for the efforts, but as we see problem is not completely solved, so any clarification of showing $Y$(discussed in the below answer) is closed or other ways maybe, would be so appreciated!

REPLY [2 votes]: Solution by "ifk" at http://www.artofproblemsolving.com/community/c7h360582p1972843 . There, $(X,d)$ is the metric space, and we are to prove $f$ is both surjective and isometric.

Let $x\in X$. 
  Define $x_{0} = x, \ x_{n+1} = f(x_{n})$.
  By compactness $\{x_{n}\}_{n}$ has convergent (in particular Cauchy) subsequence $\{x_{n_{k}}\}_{k}$.
  W.l.o.g. $\{n_{k+1} - n_{k}\}_{k}$ is increasing.
We will show that the sequence $\{x_{n_{k+1} - n_{k}}\}_{k}$ converges to $x$.
  Let $\varepsilon > 0$. 
  Since $\{x_{n_{k}}\}_{k}$ is Cauchy sequence, then for sufficiently large $k$ we've got $d(x_{n_{k}}, x_{n_{k+1}}) < \varepsilon$.
  Now $d(x_{n_{k}}, x_{n_{k+1}}) \ge d(x_{n_{k+1} - n_{k}}, x)$.
Since $\{x_{n}\}_{n\ge 1} \subset f(X)$ it follows that $f(X)$ is dense in $X$.
Now suppose that $d(f(x), f(y)) > d(x,y)$ for some $x,y\in X$.
  Define $\{x_{n}\}_{n}$ as before and similarly $y_{0} = y, \ y_{n+1} = f(y_{n})$
  By the preceding argument there exist sequence $\{n_{j}\}_{j}\subset \mathbb{N}$ s.t. $x_{n_{j}}\to x, \ y_{n_{j}}\to y$ as $j\to \infty$.
  Then 
  $$
d(f(x), f(y)) = d(x_{1},y_{1}) \le d(x_{n_{j}},y_{n_{j}})\to d(x,y)
$$
  so $d(x,y) < d(f(x),f(y) \le d(x,y)$,
  contradiction.
Therefore $f$ is isometry, in particular continuous mapping.
  Hence $f(X)$ is compact, in particular complete, in particular $f(X) = \text{cl}(f(X)) = X$. Q.E.D.