Which set cannot be the image of $(0,1]$ under a continuous function and why .
Option $A$ $\rightarrow $ $\mathcal constant \ \ function$
Option $C$ $\rightarrow$ $f(x)=1-x$
Option $D$ $\rightarrow$ $f(x)=|2x-1|$
The impossible one is option $B$. Here are two different explanations :
$1)$If possible , let us assume that $f((0,1])=(0,1).$ So, In $(0,1)$ we can find two sequences(Since this is not compact) that do not converge in $(0,1)$. Say $$w_n\rightarrow 0$$ and $$z_n\rightarrow 1$$. Since , $(0,1)$ is the image of $(0,1]$ under $f$ , we can write $$w_n=f(x_n)$$ and $$z_n=f(y_n).$$ For two sequences $x_n$ and $y_n$ in $(0,1].$ If both $x_n$ and $y_n$ have convergent subsequences in $(0,1]$ then by continuity of $f$ , $f(x_n)=w_n$ and $f(y_n)=z_n$ both have convergent subsequences and eventually converge in $f((0,1]=(0,1)$ , which is not the case. But in $(0,1]$ , the only chance of a sequence not having a convergent sub sequence is that , it converges to $0$ . This is how we ensure that :
By Bolzano-Weierstrass Theorem , we know that Every bounded sequence has a convergent sub sequence(In the completion of the sub space of $\mathbb R$ in consideration). So every sequence in $(0,1)$ has a convergent sub sequence in $\bar{(0,1]}=[0,1].$ The only limit point of $(0,1)$ that is not in $(0,1]$ is $0$ . Thus , both $x_n$ and $y_n$ must have $0$ as their limit in order not to converge in $(0,1].$
But then $$\lim_n x_n=0=\lim_n y_n\\i.e.\ \ \lim_n f(x_n)=f(0)=\lim_n f(y_n)\\ i.e.\ \ 0=f(0)=1$$ which is totally absurd . So, $$f((0,1])\neq (0,1)$$. Proved.
$2)$ We can write $$[0,1]=\{0\}\cup (0,1].$$ NOw for compactness , $$f([0,1])=C$$ for some connected,compact set $C$. Now , $$C=f([0,1])=f(\{0\})\cup f((0,1]).$$ Dependeng on whether $f$ is injective or not , $$f((0,1])=C\backslash \{y\}\\or,\ \ f((0,1])=C.$$ So, for $B)$ to be true , we need $$(0,1)=C\backslash \{y\} \ or\ C$$ but $(0,1)$ is not of that form . So , we have arrived at a contradiction again. So $B)$ is not true. Proved.