TITLE: Continuous real-valued functions defined on non-compact spaces
QUESTION [6 upvotes]: A continuous real-valued function defined on a compact space is bounded and attains its bounds. Is it so that on a non-compact space it is always possible to define a continuous function that does not have these properties? (In fact, this is the case if the non-compact set lies in a finite-dimensional normed vector space, because in this case the set is either not closed or not bounded.)

REPLY [2 votes]: No. A space with your property is called pseudocompact. A pseudocompact space need not be compact: for example, an infinite set with the particular point topology.

REPLY [2 votes]: No, it is not: there are $T_3$ spaces on which every real-valued continuous function is constant.  E.  K.  van  Douwen,  A  regular  space  on  which  every  continuous  real-valued  function  is  constant,  Nieuw
Arch. Wisk.  20  (1972),  143-145, is a particularly nice example.