The question is about the homeomorphic image of right closed interval; I know the answer but I am a little confused. Let $f:\mathbb{R}\to \mathbb{R}$ be  a continuous map. Which one of the following can not be the image of $(0,1]$ under $f$?


$\{0\}$
$(0,1)$
$[0,1)$
$[0,1]$


(I am really confused about the mappings of intervals, please suggest the links. ). Also I know that the 2nd option is correct but I am not sure about how. Please explain.
I only treat $(0,1)$, the other cases are not difficult. Assume that a continuous map $f : \mathbb R \to  \mathbb R$ has the property $f((0,1]) = (0,1)$. Then $f([0,1]) = (0,1) \cup \{f(0)\}$. On the left hand side we have a compact subset of $\mathbb R$, but the set on the right hand side cannot be compact because $[0,1]$ is the smallest compact set containing $(0,1)$. This shows that no such $f$ exists.

Note that there exist continuous maps $g : (0,1] \to  \mathbb R$ such that $g((0,1]) = (0,1)$. As an example take
$$g(x) = \frac{1}{2} +  \frac{1-x}{2}\sin  \frac{1}{x} .$$
As $x \to 0$, $g(x)$ oscillates increasingly rapidly around the line $y =  \frac{1}{2}$ and comes arbitrarily close to the lines $y = 0$ and $y = 1$. However, there is no limit $\lim_{x\to 0} g(x)$.
$(0,1)$ is the image under $f(x)=\frac{1}{\pi}\arctan(x)+\frac{1}{2}$, e.g.

$\{0\}$ is the image under the obvious constant map.

$[0,1)$ is the image under $f(x)=\frac{x^2}{1+x^2}$.

$[0,1]$ under $$f(x)=\begin{cases} 0 &amp; x \le 0\\
                                   x &amp; x \in [0,1]\\
                                   1 &amp; x \ge 1\\
                     \end{cases}$$

which is continuous too.

That is for $\Bbb R$.

We can find $-x + 1$ to get $[0,1)$ and a similar casewise function to get $[0,1]$ and $\{0\}$ is easy as before. Only $(0,1)$ as image seems tricky..

For $(0,1]$ onto $(0,1)$ consider what point $f(1)$ can be. Suppose it's $0 &lt; p &lt; 1$, then $f[(0,1)]$ must be connected so $p$ must be the image of at least one other $x \in (0,1)$ under $f$, otherwise $f[(0,1)] = (0,1)\setminus \{p\}$ would be disconnected. Then argue that $f^{-1}[\{p\}]$ cannot be finite (using components again). But this set must have a limit point in $[0,1]$ ...  

Admittedly, it's a tricky argument, but off hand I see no better one. Of course it's multiple choice and I showed how to get the other 3 as image, so elimination also works. Maybe that was the idea of the question.