This would be a comment if I had enough reputation. Your assumptions make $f$ into a ring homomorphism $\mathbb{R} \to \mathbb{R}$. Thus this question is answered in this question. (In short, after you have shown that the restriction to $\mathbb{Q}$ is the identity, you can use the ordering and density of $\mathbb{Q}$ in $\mathbb{R}$ to show that $f$ is continuous.)
EDIT (in reply to a comment)
Let's skip continuity and take advantage of the ordering. We wish to show that
$$ x < y \Rightarrow f(x) < f(y),$$
because with this we can 'squeeze' the values of the function in irrational points to the identity without explicitly saying the word 'continuous'.
Note that to show our claim it suffices to prove that for all $x$ and $y$ we have
$$ \frac{y}{x} > 0 \Rightarrow \frac{f(y)}{f(x)} > 0,$$
and since by assumption $f(ab) = f(a)f(b)$ it is sufficient to show that
$z > 0 $ implies $f(z) > 0$. But this is not hard, because if $ z > 0$, then for some $w > 0$ it holds that $z = w^2$, and so
$$f(z) = f(w w) = f(w) f(w) = f(w)^2 > 0.$$
Thus $f$ is order preserving, and if it is the identity on the rationals, it must be an identity map on all of $\mathbb{R}$.