Continuous function from $(0, 1]$ onto $(0, 1)$?

**Answer without words! see the figure **enter image description here


Something like $$x\mapsto \frac{1+(1-x)\sin(1/x)}{2} $$ will do.