# GRE analysis problem

I am trying to prove the existence of continuous onto function from (0,1) to [0,1]. Well, it was easy, since $\sin(\dfrac1{x(x-1)})$ does what I need.

BUT... a slight tweak to the definition of continuity grants that the preimage of a closed set is closed. Well, [0,1] is closed, but (0,1) is NOT!

What is wrong with it?

• $(0,1)$ is closed in $(0,1)$: any topological space is a closed subset of itself.
– Pedro
Sep 16, 2016 at 4:33
• And $(0,1/4]$ is likewise closed in $(0,1)$. Just sayin' ... Sep 16, 2016 at 4:40
• And $(0,1)$ is open and closed. Sep 16, 2016 at 4:49
• Just wondering, is there any reason that a simple piecewise function wouldn't work? Take $$f(x) = \begin{cases}0 & x \in (0, 1/4) \\ 2(x - 1/4) & x \in [1/4, 3/4] \\ 1 & x \in (3/4, 1) \end{cases}$$ because I never would have thought of $\sin(1/(x(x - 1)))$
– JMK
Sep 16, 2016 at 4:53
• Or how about $sin^2(2\pi x)$? Sep 16, 2016 at 4:55