Image of (0,1] under continous function Let $f: \mathbb{R} \to \mathbb{R}$ be a continuous function. Which of the following sets cannot be image of $(0,1]$ under $f$.


*

*{$0$}

*$(0,1)$

*$[0,1)$

*$[0,1]$
My initial guess was using intermediate value theorem, but it seems hopeless here. What concept could one use here to solve this question?
 A: Hint: Consider two sequences $(x_n),(y_n)\subseteq(0,1]$ so that $f(x_n)\to 0$ and $f(y_n)\to 1$. You can get convergent subsequences for each of them, and use continuity to figure out where the value at the function of the limit point ends up.
Alternatively, just consider $f([0,1])$, which must be a closed interval by intermediate value theorem.* Now what can $f((0,1])$ be?
*-The theorem you will learn for metric spaces would be "compactness is preserved by a continuous transformation".
A: I also suggest to use concrete examples. You have to be careful because you can't directly argue that by pre-image of open(closed) set under continuous function is open (closed), because in general $A\subset f^{-1}(f(A))$.
for 1, $y=0$,
for 3, $y=1-x$,
for 4, $y=4(x-\frac{1}{2})^2$,
so it gives you 2 be the answer. 
For a direct proof, use compactness is preserved under continuous functions. If $f(0,1]=(0,1)$, and $(0,1)\subset f[0,1]$ which is compact (hence closed), then we have $[0,1]\subset f[0,1]$, which means $f(0)$ should correspond to 2 values at least, ie. $0$ and $1$, which is impossible.
