$X $ is complete if every real valued continuous function on $X $ is uniformly continuous If every real valued continuous function on $X $ is uniformly continuous,then is $X$ complete?
My attempt:let $x_n$ be a Cauchy Sequence in $X$. Let $f$ be a real valued continuous function. To show $x_n \rightarrow x$ for some $x\in X$.since $f$ is uniformly continuous it takes Cauchy to Cauchy hence $f(x_n)$ is Cauchy in $\mathbb R$ hence $f(x_n)$ converges in $\mathbb R$ to .But how to show that $x_n$ converges in $x$.Any help
 A: To get your result, you have to choose correctly the function $f$; otherwise, you'll get nowhere.
The easiest way to prove what you want is to argue by contradiction. So, assume that $X$ is not complete, and let $(x_n)_{n\in\mathbb N}$ be a Cauchy sequence in $X$ which is not convergent. Without loss of generality, we may assume that the $x_n$'s are all distinct.
Being Cauchy and not convergent, the sequence $(x_n)$ cannot have any convergent subsequence. Hence, any convergent sequence of points taken from the set $C:=\{ x_n;\; n\in\mathbb N\}$ is stationary. It follows that the set $C$ is closed in $X$, and that any function $f:X\to\mathbb R$ is continuous.
Now, define $f:C\to \mathbb R$ as follows: $f(x_n)=n$ for all $n\in\mathbb N$. Since $f$ is continuous and $C$ is closed, the function $f$ can be extended to a continuous function $F:X\to\mathbb R$ (this is a special case of the Tietze extension theorem, which is easy in the metrizable case). By assumption, $F$ is uniformly continuous on $X$, and hence $f$ is uniformly continuous on $C$. This is the required contradiction since $f$ takes the Cauchy sequence $(x_n)$ to a non-Cauchy sequence.
