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.
Some point in the interior of $(0,1]$ will have to map to $0$. I picked $1/2$. Then the rest of the function has to never pass below $0$, so I squared it. Then it needs to actually cover up to and including $1$, so multiply by $4$. The collection of choices here should indicate that there are many such functions.
You could even cover this interval with only the domain $(0,1)$ using a similar method -- minimum at 1/3, maximum at 2/3, cubic...