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?
Fundamental theorem of Arithmetic can be interpreted as saying that the set of positive rational numbers under multiplication is a free abelian group with prime numbers as basis.
So one can define an endomorphism of the group by specifying it arbitrarily on primes. (An endomorphism is also a function from rationals to real numbers as required by you)
For example define $f(1)=1, f(p) = p$ for primes less than 100, and $f(p) = 1$ for primes $ p > 100$, and extend it multiplicatively. This is in particular not a 1-1 function and satisfies your functional equation and is not of the form $f(x) = x^a$.