I wonder if it is possible to construct a continuous $f : \mathbb R \to \mathbb R$ such that for each $x \in \mathbb R$, $f(x)$ is irrational if and only if $x$ is rational?
my attempt
Sadly, I pretty much don't know where to start with this one. Intuitively I feel this is impossible. But I just can't see what could go wrong. Any help would be appreciated. Thanks!