If the sets $\{x:f(x)>a\}$ and $\{x:f(x)<a\}$ are open for every rational $a$, show that $f$ is continuous
$f:X\longrightarrow\mathbb{R}$ is continuous iff $\{x\in X:f(x)\geq\alpha\}$ and $\{x\in X:f(x)\leq\alpha\}$ are closed $\forall\alpha\in\mathbb{R}$