# nonempty subset $E$ of $R$ closed and bounded iff every continuous real-valued function on $E$ takes a maximum value.

I need to show that a nonempty subset $E$ of $R$ is closed and bounded iff every continuous real-valued function of $E$ takes a maximum value.

• I believe that "if $E$ is closed and bounded, then every continuous real-valued function on $E$ takes a maximum value" is the Extreme Value Theorem (correct me if I'm wrong). We proved the Extreme Value Theorem in class, so I don't need to prove this part (unless, of course, it turns out that it's not the Extreme Value Theorem. Please let me know so that I can avoid this kind of embarassment.)
• Now, in the other direction, we must show that "Every continuous real-valued function on $E$ takes a maximum value implies that $E \subseteq \mathbb{R}$ is closed and bounded. This is where I'm having difficulty.

So far, I have the following:

Suppose that every continuous real-valued function on $E$ takes a maximum value on $E$. Then, $f(E)$ is bounded. Since $f$ is bounded on $E$, $\exists M \geq 0$ such that $|f(x)| \leq M$ $\forall x \in E$, which in turn implies that $-M \leq f(x) \leq M$. Let $x_{1}$ be the point in $E$ where $f(x_{1})=-M$ and $x_{2}$ the point in $E$ where $f(x_{2}) = M$.

Now, if $E$ were necessarily an interval, I could invoke the IVT to guarantee the existence of a point $x \in E$ such that $f(x)= x$ (actually, I suppose this would be the fixed point theorem). But, I suppose that I can't necessarily suppose $E$ is an interval. So, I'm having difficulty showing this means that $E$ is bounded.

This question is almost identical to the one I am asking, but the guy who gave the first answer (the answer I find most helpful) said that $|f(x)|\leq E$ implies that $E$ is bounded with zero justification.

I am also having trouble showing $E$ is closed. In his answer, the guy gave an example that is so incredibly simple that of course it will work. But, I need to be able to show it for a much more general function $f$, where the trick he used will not necessarily work.

• In the first answer to the linked question, the function under consideration is $f(x) = \|x\|$. Boundedness of $f$ means that $|f(x)| \leq M$ for all $x\in E$ which means that $\|x\| \leq M$ for all $x \in E$ which means that $E$ is contained in the ball of radius $M$ centered at the origin. So $E$ is bounded. In your case, since you are working in $\mathbb{R}^1$, you can use the ordinary absolute value function in place of $\|\cdot \|$. – Bungo Sep 30 '15 at 16:43
• Regarding your second question (showing that $E$ is closed), why do you need to "show it for a much more general function $f$"? You want to show that if every continuous function on $E$ assumes a maximum value, then $E$ is closed. So prove the contrapositive: if $E$ is not closed, then construct an example of a continuous function which is not bounded. You only need one such example. – Bungo Sep 30 '15 at 16:49
• @Bungo in the linked question, the function under consideration is $f(x) = \Vert x \Vert$, or in this case, the function under consideration is $f(x) = \Vert x \Vert$? Is it in this case because of what I said about the Intermediate Value Theorem? But, I thought the IVT didn't apply because we do not know necessarily that the set from $f(x_{1}) = -M$ to $f(x_{2})=M$ wasn't an interval. – ALannister Oct 1 '15 at 14:05
One way is just the $\bf{Extreme Value Theorem}$ (as you said). For the other part suppose that $E$ is not bounded then consider $e\in E$ and the map $x\mapsto d(x,e)$ which is a continuous function and it doesn't attain it's maximum.
If $E$ is not closed then can you construct some continuous function (something related to distance function) which doen not attains it's maximum ?