Let $ f: X \rightarrow R^n$ continuous, where $ (X, d) $ is an arbitrary metric space. Prove or give a counterexample for the assertion that the set $M=\{x\in X:f(x) \ne 0\} $ is an open set.
I'm thinking this might be fake. In the discret metric it seems true. So I'm thinking of an any metric $d$ and for the special case with $ X = \mathbb {R} $ and $ n = 1 $.
I thought for the following functions:
1) $ f (x) = x \Longrightarrow M = (- \infty, 0) \cup (0, \infty) $. This set is opened.
2) $ f (x) = x ^ 2 \Longrightarrow M $ is an open set.
So I conclude that if the roots of $ f $ is a finite quantity, we have that $ M $ is open. Now if it is an infinite contable quantity, for example for $ f (x) = \sin x $, we have that $ M $ will be open.
So I thought of the following function $$ f (x) = x \sin \left(\dfrac {1} {x} \right), x \neq 0 \; \mbox {and} \; \; f(x)=0, x = 0. $$
The roots of this function get closer and closer to zero because the roots $ x \neq 0 $ are of the form $ x = \dfrac {1} {2k}$ with $ k \in \mathbb {Z} $. I thought I would have a counterexample here because I know I have points of $ M $ and points of $ \mathbb{R} \backslash M $ each time closer to each other. But I have not been able to conclude that this is indeed a counterexample.
$$M = f^{-1} \left( \mathbb{R}^n \setminus \lbrace 0 \rbrace \right)$$
is open as the preimage of the open set $\mathbb{R}^n \setminus \lbrace 0 \rbrace$ by the continuous application $f$.