# Thread: How could we show that D is bounded and closed?

1. Hey!!

Let $D\subseteq \mathbb{R}$ be a non-empty set. I want to show that $D$ ist compact if and only if each continuous function is bounded on $D$.

I have done the following:

We suppose that $D$ is compact. Since $f$ is continuous, we have that $f(D)$ is also compact, right?
We have that a set is compact iff it is bounded and closed.
Therefore, we have that $f(D)$ is bounded, and so $f$ is bounded on $D$.

Let $f$ be a continuous function that is bounded on $D$.
Since $f$ is bounded on $D$, we have that $f(D)$ is bounded.
To show that $D$ is compact we have to show that $D$ is bounded and closed.
Could you give me a hint how we could show that?

2. Originally Posted by mathmari
Hey!!

Let $D\subseteq \mathbb{R}$ be a non-empty set. I want to show that $D$ ist compact if and only if each continuous function is bounded on $D$.

I have done the following:

We suppose that $D$ is compact. Since $f$ is continuous, we have that $f(D)$ is also compact, right?
We have that a set is compact iff it is bounded and closed.
Therefore, we have that $f(D)$ is bounded, and so $f$ is bounded on $D$.

Let $f$ be a continuous function that is bounded on $D$.
Since $f$ is bounded on $D$, we have that $f(D)$ is bounded.
To show that $D$ is compact we have to show that $D$ is bounded and closed.
Could you give me a hint how we could show that?
Suppose that each continuous function on $D$ is bounded.

We argue that $D$ is closed. Suppose not. Then there is a point $b\notin D$ such that $b$ is in the boundary of $D$. Define $f: D\to \mathbf R$ as $f(x)=1/(x-b)$. Then $f$ is an unbounded continuous function on $D$. This is a contradiction.

Now since the map $g: D\to \mathbf R$ defined as $g(x)=x$ for all $x\in D$ is bounded, we infer that $D$ is bounded.

Therefore $D$ is closed and bounded, and thus compact.

Originally Posted by caffeinemachine
Then there is a point $b\notin D$ such that $b$ is in the boundary of $D$. Define $f: D\to \mathbf R$ as $f(x)=1/(x-b)$. Then $f$ is an unbounded continuous function on $D$. This is a contradiction.
Why is $f$ unbounded?

Do we apply $f$ at $x_n$, and since $x_n\rightarrow b$, $x_n$ is arbitrarily close to $b$, therefore $x_n-b$ is arbitrarily close to $0$, and so $f(x)$ goes to infinity?

4. Originally Posted by mathmari
Why is $f$ unbounded?

Do we apply $f$ at $x_n$, and since $x_n\rightarrow b$, $x_n$ is arbitrarily close to $b$, therefore $x_n-b$ is arbitrarily close to $0$, and so $f(x)$ goes to infinity?
That is correct.