how to solve this exercise:
Let $f: (E,d)\to (\mathbb{R},|.|)$ a map, prove that if for each $\lambda\in \mathbb{R}$ the sets $$ A=\{x\in E, f(x)<\lambda\}, B=\{x\in E, f(x)>\lambda\} $$ are open then $f$ is continuous.
I know that $f$ is continuous if and only if the inverse image of each open set is open,
but how to use the sets $A$ and $B$?
Thank you
Let $c \in E.$ Let us choose $\varepsilon > 0$ arbitrarily. Consider two sets $$\begin{align} A & =\{x \in E : f(x) < f(c) + \varepsilon \}\ \text {and}\ B = \{x \in E: f(x) > f(c) - \varepsilon \}. \end{align}$$ Observe that $c \in A \cap B.$ By the given hypothesis both $A$ and $B$ are open. So $\exists$ $\delta_1,\delta_2>0$ such that $f(x) < f(c) + \varepsilon,$ for all $x \in E$ satisfying $d(x,c) < \delta_1$ and $f(x) > f(c) - \varepsilon,$ for all $x \in E$ satisfying $d(x,c) < \delta_2.$ Let $\delta = \min \{\delta_1, \delta_2 \}.$
Can you proceed now?