TITLE: $f:\mathbb R\to\mathbb R$ continuous function. Which of the following sets can not be image of $(0,1]$ under $f$?
QUESTION [12 upvotes]: Let $f:\mathbb R\to\mathbb R$ continuous function. Which of the following sets can not be image of $(0,1]$ under $f$?


A. $\{0\}$.
B. $(0,1)$.
C.$[0,1)$.
D.$[0,1]$.


My effort: Continuous image of connected set connected. $(0,1]$ is connected and remove $1$ from the set left the set connected...but removing any point from $(0,1)$ make it disconnected.....I am not sure though

REPLY [11 votes]: If $f\colon\mathbb R\to\mathbb R$ is continuous, then the image of any compact set is compact. Especially, the image of $[0,1]$ is a compact set $C$. Then the image of $(0,1]$ is either $C$ or $C\setminus\{y\}$ for $x=f(0)$. The set $(0,1)$ is not of this form, hence cannot be the image of $(0,1]$.
For A, C, D one readily finds specific functions: $f(x)=0$, $f(x)=1-x$, $f(x)=|2x-1|$.