$(X,d)$ is a metric space such that every continuous function $f: X \rightarrow \mathbb{R}$ is bounded. Prove $X$ is complete.

banach-spacesfunctional-analysismetric-spacesproof-verification

I'm practicing an exam question and would appreciate having my proof verified.

Let $(x_n)$ be a Cauchy sequence in $X$. Suppose $f: X \rightarrow \mathbb{R}$ is a continuous (and therefore bounded) function.

Then, $(f(x_n))$ is a bounded sequence in $\mathbb{R}$. By Bolzano-Weierstrass, there exists a subsequence $(f_{n_k})$ that converges to some $y \in \mathbb{R}$. Therefore, there exists a ball $B$ of radius $\epsilon$ centered at $f(x_{n_k})$ that contains $y$ and all $f(x_{n_j})$ for $j \geq k$.

Let $B' = f^{-1}(B)$ denote the preimage of $B$ in $X$. By the continuity of $f$, $B'$ is an open ball of in $X$ which contains all $x_{n_j}$ for $j \geq k$ and $f^{-1}(y) =: x$. Thus, the subsequence $x_{n_k}$ converges to $x \in X$.

Lastly, this implies that $x_n$ converges to $x$ since $$d(x_n, x) \leq d(x_n, x_{n_k}) + d(x_{n_k}, x) < \epsilon$$ by the triangle inequality.

Best Answer

$B'$ is not an open ball. It's open, yes, but it doesn't have to be a ball. Also, $f^{-1}(y)$ can have several values at once, and you don't really know that any of them are the limit of the $x_n$.

You have only used that there exists a continuous and bounded function. That's not the whole strength of the hypothesis, and it's not enough. I would suggest you construct a specific function in a clever way, and then use the fact that if it is continuous, then it is bounded. And then use the cleverness with which it was constructed to show that the space is complete. Or at least that some given Cauchy sequence converges.

Here is one approach, showing the contrapositive instead (I always consider the contrapositive; some times the proof for one variation comes much easier than the proof for the other). Which is to say, if $X$ is not complete, then there is a continuous, unbounded function $X\to\Bbb R$.

Assume $X$ is not complete. Let $x_n$ be a Cauchy sequence in $X$ which is not convergent. Then define the function $f:X\to\Bbb R$ as follows: $$ f(x)=\frac1{\lim_{k\to\infty}d(x,x_k)} $$ It is well-defined and continuous (this must be shown), but $f(x_n)$ goes to $\infty$ as $n$ increases, so it isn't bounded (this must also be shown).