1. The problem statement, all variables and given/known data Prove that if every continuous real-valued function on a set X attains a maximum value, then X must be compact. 2. Relevant equations None really. 3. The attempt at a solution None really, not sure where to start. I know that if a space is compact, every function attains it's minimum and maximum values, and I was thinking that I could show that if the space is not compact, then there is some continuous real-valued function that cannot attain a max value. I'm not really sure where to begin, though. Suggestions?