I'm guessing $\{ a + b\sqrt{2} \ : \ a, b \in \mathbb{Z} \}$ is dense in $\mathbb{R}$. I'm having a mental block. How do you show that?
(This is motivated by a different hypothesis: if $f$ is continuous with two periods $T_1$, $T_2$, then $f$ is constant if $T_1/T_2$ is not rational.)