# Continuous function from (0,1) onto [0,1]?

by dumbQuestion
Tags: continuous, function
 P: 126 I know that there does not exist a continuos function from [0,1] onto (0,1) because the image of a compact set for a continous function f must be compact, but isn't it also the case that the inverse image of a compact set must be compact? and a set in R is compact iff its closed and bounded right?
P: 1,622
First consider the continuous surjection $f:(0,1) \rightarrow [0,1]$ defined as follows:
$$f(x) = \left\{ \begin{array}{lcl} 0 & : & x \in \left(0,\frac{1}{4}\right)\\[0.3em] 2x-\frac{1}{2} & : & x \in \left[\frac{1}{4},\frac{3}{4}\right]\\[0.3em] 1 & : & x \in \left(\frac{3}{4},1\right) \end{array} \right.$$

 Quote by dumbQuestion but isn't it also the case that the inverse image of a compact set must be compact?
Not all continuous maps satisfy this property. Those that do are called 'proper'.

 and a set in R is compact iff its closed and bounded right?
Assuming that you give $\mathbb{R}$ its usual topology and assuming you mean bounded with respect to the Euclidean metric, then yes.