The title says it all, really. I'm confronted with this problem from my topology course, and I have made no progress. I'm not sure if I'm supposed to solve it with the "standard" topology on R or something else, but I think its true even with the "standard" topology- I just can't find such a function.
I would add that this is an introductory course in topology and I don't know most advanced notions.