This question already has an answer here:
Let $\Bbb Q^+$ be the set of positive rational numbers. Find all solutions $f:\Bbb Q^+ \to \Bbb R$ of the functional equation $$ f(xy)=f(x)f(y), \quad x, y\in \Bbb Q. $$
Is $f(x)=x^a$ the only solution? If not, is it true if we assume that $f$ is continuous?