I'm trying to show that in $\mathbb{R}$ a pseudocompact set is compact. That is, if $X\subset \mathbb{R}$ is such that all continuous functions $f: X\to \mathbb{R}$ are bounded, then $X$ is compact.
One possible proof that I've seem sometimes is just to assume there is a sequence with no convergent subsequence, and then construct one function which is continuous but which is not bounded.
The possible constructions I've seem are quite non intuitive and hard to grasp. Is there any other proof of this result without needing to in fact construct a function which is not bounded? Isn't there any way to just show that such a function would exist if $X$ were not compact?
If this can't be done and the construction is required, how can one understand how to construct such function? That is, how can one find that functions instead of just showing it and saying: "it works"?
Hint: It is enough to show that $X$ is closed and bounded so use $f(x)=x$ and $g(x)=\frac{1}{x-x_0}$