TITLE: If $X$ is complete, then there is no continuous and open $\,f:X \to \mathbb{Q}$
QUESTION [5 upvotes]: I've encountered the following question and got stuck :
There is no continuous and open mapping $\,f:X \to \mathbb{Q},$ where $X$ is a complete metric space.
I thought it had something to do with Baire's category theorem, because this is the only way I could  see both the completeness of $X$ and openness of $f$ take a part in the proof, but I didn't manage to prove it.

REPLY [5 votes]: Indeed, this is an application of Baire's Theorem.
Let $q\in\mathbb Q$. We shall first show that $V=f^{-1}(\mathbb Q\smallsetminus\{q\} )$ is open and dense in $X$. It is clearly open, as $f$ is continuous. If $V$ were not dense, then there would be an open ball $B(x,\varepsilon)$ in $X$ (with $x\in X$ and $\varepsilon>0$), such that
$$
V\cap B(x,\varepsilon)=\varnothing.
$$ 
But, as $f$ is open, then $f\big(B(x,\varepsilon)\big)$ is open, and hence 
$$
f\big(B(x,\varepsilon)\big)\cap\big(\mathbb Q\smallsetminus\{q\}\big)\ne\varnothing.
$$
A contradiction, and hence $V$ is dense.
Now, let $\{q_n\}$ an enumeration of $\mathbb Q$ and $W_n=\mathbb Q\smallsetminus\{q_n\}$. Then $\bigcap_{n\in\mathbb N}W_n=\varnothing$, and hence
$$
\varnothing=f^{-1}\left(\bigcap_{n\in\mathbb N}W_n\right)=\bigcap_{n\in\mathbb N}f^{-1}(W_n).
$$
A contradiction, due to Baire's theorem, as each of the $V_n=f^{-1}(W_n)$ is open and dense.