# Math Help - compact subset of R

1. ## compact subset of R

Suppose that $A$ is a compact subset of $\mathbb{R}$ and $f: A \rightarrow \mathbb{R}$ is continuous. Prove that the set $\{x \in A | 0 \leq f(x) \leq 1 \}$ is a compact subset of $\mathbb{R}$.

I know that the set $\{x \in A | 0 \leq f(x) \leq 1 \}$ is bounded because $A$ is bounded, so I guess I just need to prove that $\{x \in A | 0 \leq f(x) \leq 1 \}$ is closed. I was thinking to take a sequence in the set and show that it converges in the set. This is what is confusing me because I don't know how to do this part. Thanks for any help in advance.

2. Use the notation: $B = \left\{ {x \in A:0 \leqslant f(x) \leqslant 1} \right\}$.
Theorem: Any closed subset of a compact set is compact.
You should have proved that theorem, if not it is easily proven.
Thus, you want to prove that the set $B$ is closed.
If $B$ were not closed then some limit point, $x_0$, of $B$ and $x_0 \notin B$.
Then there is a sequence of distinct points from $B$ which converges to $x_0$.
Remembering that $f$ is continuous, there is a contradiction there.

3. Originally Posted by junipers232
Suppose that $A$ is a compact subset of $\mathbb{R}$ and $f: A \rightarrow \mathbb{R}$ is continuous. Prove that the set $\{x \in A | 0 \leq f(x) \leq 1 \}$ is a compact subset of $\mathbb{R}$.

I know that the set $\{x \in A | 0 \leq f(x) \leq 1 \}$ is bounded because $A$ is bounded, so I guess I just need to prove that $\{x \in A | 0 \leq f(x) \leq 1 \}$ is closed. I was thinking to take a sequence in the set and show that it converges in the set. This is what is confusing me because I don't know how to do this part. Thanks for any help in advance.
Lemma 1. Each closed subset of a compact space is compact.

Since f is continuous, each closed subset C of $\mathbb{R}$, $f^{-1}(C)$ is closed in A.

By lemma 1, $\{x \in A | 0 \leq f(x) \leq 1 \}$ is compact. Now, you'll see that $\{x \in A | 0 \leq f(x) \leq 1 \}$ is a compact subset of $\mathbb{R}$.