I'm not sure that I understand your question, but if S is a closed set then
and since for all , we conclude that . If is an open set you should find a sequence of numbers that converges to and use the continuity property to prove that (follow this link)
It is not the case that is either open or closed.
It is the case that .
Now this argument works.