# Why is a function that maps a closed interval to a open one not onto?

First I'll state my current mathematical knowledge on the subject of homeomorphisme: very low. I'm doing a class of dynamical systems and I got the following question:

Let $f:[0,1] \rightarrow (2,8)$ and $f$ is one-to-one and continuous. Now show $f$ is not onto.

So I started of by stating that $f$ is either continuously increasing or continuously decreasing, that's because $f$ is one-to-one. Now intuitively it makes sense that $f$ cannot be onto since it maps a closed interval into a open one, but I don't know how to show/prove this.

The exercise has a hint that $[0,1]$ and $(2,8)$ are not homeomorphic but I have no idea how to use this.

• We don't need $f$ to be one one. Just continuity is sufficient to conclude. Jan 10, 2018 at 11:11

The image of the compact space $[0,1]$ under the continuous function $f$ is compact, hence a proper subset of $(2,8)$ because this isn't compact.
• Since the image $\operatorname{Im}(f)$ of $f$ is compact and $(2,8)$ is not compact we cannot have $\operatorname{Im}(f)=(2,8)$, thus $f$ cannot be surjective. Jan 10, 2018 at 16:46