The function associating each point in $R^n$ with the point in X that is closest to it is Lipchitz I want to prove the following: 
Let $X \in \mathbb R^n$ be a closed and convex set. Define a function $g:\mathbb R^n \to X$ as follows: $g(x)$ is the closest point in $X$ to $x$. Then $d(g(x),g(\hat x)) \le d(x,\hat x)$ for every $x,\hat x \in \mathbb R^n$.
I got a feeling that the proof utilizing inequality triangle, but this is all I have got $d(g(x),g(\hat x)) \le d(g(x),x)+d(x,\hat x)+d(\hat x,g(\hat x))$
Any ideas? Please help me. Thanks a lot.
Edit: I would really like to see a proof that use inequality triangle, convexity and closedness of X; nothing more than that.
 A: Let $x, \hat x \in \mathbb{R}^n$ be arbitrary elements of space such that $g(x) \ne g(\hat x)$. Let $\delta = d(g(x), g(\hat x)) > 0$. Without loss of generality let us assume that $g(x) = (0, \ldots, 0)$ and $g(\hat x) = (\delta, 0, \ldots, 0)$ (you can always find isomorphism, which transform $g(x)$ and $g(\hat x)$ to $(0, \ldots, 0)$ and $(\delta, 0, \ldots, 0)$ respectively). 
Now, $X$ is convex, so $(c, 0, \ldots, 0) \in X$ for any $0 < c < \delta$. For any value $z = (z_1, z_2, \ldots, z_n)$ such that $0 < z_1 < \delta$, we have: $d(z, (z_1, 0, \ldots, 0)) < d(z, g(x))$ and $d(z, (z_1, 0, \ldots, 0)) < d(z, g(\hat x))$, so $g(z) \ne g(x)$ and $g(z) \ne g(\hat x)$.
Therefore, if $x = (x_1, \ldots, x_n)$, then $x_1 \leqslant 0$ or $x_1 \geqslant \delta$. But if $x_1 \geqslant \delta$, then $d(x, g(\hat x)) < d(x, g(x))$ - contradiction, thus $x_1 \leqslant 0$. Similarly if $\hat x = (\hat x_1, \ldots, \hat x_n)$, then $\hat x_1 \geqslant \delta$. So we have $x_1 \leqslant 0$ and $\hat x_1 \geqslant \delta$, so $d(x, \hat x) \geqslant \delta = d(g(x), g(y))$, Q.E.D.
Edit:
Why one can always find an isomorphism, which transform $g(x)$ and $g(\hat x)$ to $(0, \ldots, 0)$ and $(\delta, 0, \ldots, 0)$? 
Let $x_1 = \frac{1}{\delta}(g(\hat x) - g(x))$. Then $||x_1|| = 1.$ Linear algebra says that there exists an orthonormal basis $x_1, \dots, x_n$. And also $e_1, \ldots, e_n$ (canonical basis) is orthonormal basis. There exists a linear transformation $f$ such that $f(x_i) = e_i$. Since $x_1, \dots, x_n$ and $e_1, \dots, e_n$ are orthonormal, $f$ is a linear isomorphism (from linear algebra). Now $\mathbb{R}^n\ni x \mapsto f(x-x_1) \in \mathbb{R}^n$ is an isomorphism we need.
