Show that the function $f:[0,1] \to [0,1]$ defined by $$f(x)=\begin{cases}x & \text{if } x \in \mathbb{Q} \\ 1-x & \text{if } x \in \mathbb{Q}^c \end{cases}$$ has the intermediate value property.
Attempt: We want to show that for every $\mu$ between $f(a)$ and $f(b)$, there is some $c \in (a,b)$ such that $f(c) = \mu$. To show this, there will be three cases: first case will be $a,b \in \mathbb{Q}$, second is $a,b \in \mathbb{Q}^c$, and third $a \in \mathbb{Q}$ and $b \in \mathbb{Q}^c$. For the first case and second case, I can use the fact that $x$ and $1-x$ are continuous on $[0,1]$, and thus the IVT applies. However, for the third case, I am not sure.