The values of $f$ can be assigned arbitrarily on the elements of a Hamel basis#Hamel_basis) for the reals over the rationals, and then extended to all of $\mathbb{R}$ by $\mathbb{Q}$-linearity. So (assuming the Axiom of Choice) there are indeed weird solutions.