Show that if $f:M\to\mathbb{R}$ is continuous, $a\in\mathbb{R}$, $\{x:f(x)Exercise: Consider the two metric spaces $(M,d)$ and $(\mathbb{R},\rho)$. Show that if $f:M\to\mathbb{R}$ is continuous, $a\in\mathbb{R}$, $\{x:f(x)<a\}$ is an open set in $M$.
My solution: We want to show that $\forall x\in\{x:f(x)<a\},\exists\delta>0$ such that $B_\delta(x)\subset\{x:f(x)<a\}$. Since $f$ is continuous we know that $\forall \epsilon>0$, $\exists\delta>0$ such that $\rho(f(x),f(y))<\epsilon$ whenever $d(x,y)<\delta$. Suppose we choose an arbitrary $x_0\in\{x:f(x) < a\}$. So if we pick $\epsilon = \left| f(x_0) - a\right|$, we know that there exists a $\delta>0$ such that $\rho(f(x_0), f(y))<\left| f(x_0) - a\right|$ whenever $d(x_0,y)<\delta$. Since $f(y) < a$ if $\rho(f(x_0),f(y))<\left|f(x_0) - a\right|$, we have that $B_\delta(x_0)\subset \{x:f(x)<a\}.$ Since $x_0$ was chosen arbitrarily this holds for all $x\in\{x:f(x) <a\}$.
Question: Is this solution correct? I feel especially uncomfortable about the conclusion: $f(y) < a$ if $\rho(f(x_0),f(y))<\left|f(x_0) - a\right|$.
Edit: If this result is correct, is it then also correct to say that if $\{x:f(x)<a\}$ is open $f$ is continuous because for every $\epsilon >0$ there exists a $\delta >0$ such that $\rho(f(x),f(y))<\epsilon$ whenever $d(x,y)<\delta$? (Based on the definition of the open ball in $\{x:f(x)<a\}$ I used above)
Thanks!
 A: Observe that $\{x:f(x)<a\}=f^{-1}(-\infty,a)$. 
Since f is continous and $(-\infty,a)$ is opened in $\mathbb{R}$, we have that $\{x:f(x)<a\}=f^{-1}(-\infty,a)$ is also opened.
A: Your solution is correct. Notice that $\rho(y,z) = |y-z|$ by definition, so the point that puzzles you can be thought of as follows. If you had $f(y) \ge a$, then 
$$ |f(y)-f(x_0)| = |f(y)-a+a-f(x_0)| = |f(y)-a| + |a-f(x_0)| \ge \varepsilon$$
which is a contradiction to the assumption.
A: Assuming that $\rho$ is the standard metric on $\Bbb R$, then your idea is correct, and most of your execution is good. I would've preferred a bit more line breaks so that your proof isn't a single block of text, but that's just aesthetics.
Your uncomfortable point can be rephrased to: If $f(x_0)<a$, and $f(y)$ is closer to $f(x_0)$ than $a$ is, then is $f(y)<a$? This is a simple application of the triabgle inequality and very much true.
As to your edit, no, that's not true. The floor function as a function from $\Bbb R$ to $\Bbb R$ has this property but is not continuous.
