[Math] A continuous surjective function from $(0,1]$ onto $[0,1]$

continuityfunctionsgeneral-topologyreal-analysis

I'm trying to construct a continuous surjection from $(0,1]$ onto $[0,1]$, but I'm not getting anywhere. I don't immediately see a contradiction which falsifies the existence of such a function, so my intuition tells me one exists. I feel like an absolute value function would work, but I'm not sure how to arrive at it in the proper way. Thanks for any help.

Best Answer

Try $f(t) = \sin(1/t)$.

If you want to use your absolute value idea, try making a $V$ shape with the vertex at $(\tfrac12, 0)$, opening upwards to include the points $(0,1)$ and $(1,1)$. (I'll leave the actual function up to you.)

Related Question