I did the same things as you, but I can't proof that each is open.
Here I give a counterexample that is not open :
let f be defined as :
;
if x is in the set of rational numbers except 0;
if x is in the irrational numbers set.
Then is not open.
Any way , thank you all the same !
I've also got a new idea!
I made a little change to : By let