# The preimage of a closed set is closed

There must exist a continuous surjective function $f$ from $(0,1)$ to $[0,1]$. Since $f$ is continuous and $[0,1]$ is closed, then $f^{-1}([0,1])$ is closed either. However, $f^{-1}([0,1])=(0,1)$, which is open in $\mathbb{R}$.

How should I understand the statement that "the preimage of a closed set is closed"?

• $(0,1)$ is open in $\mathbb{R}$, sure. But it's closed in the subspace topology on $(0,1)$, which is the relevant space. – Patrick Stevens Mar 29 '17 at 7:52
• The domain of $f$ is $(0,1)$, not $\mathbb{R}$, and $(0,1)$ is certainly closed in itself. – quasi Mar 29 '17 at 7:53
• For an example of a continuous surjective function from $(0,1)$ to $[0,1],\;$ let $$f\;{:}\;(0,1) \to [0,1]\;\;\text{be defined by}\;\;f(x) = \sin{2\pi x}$$ – quasi Mar 29 '17 at 8:06