Solve functional equation $f(x_1 x_2) = g_1(x_1) g_2(x_2)$

Let $x_1$ and $x_2$ be real positive numbers. The problem is to find all possible triples of $f$,$g_1$,$g_2$ such that $f(x_1 x_2) = g_1(x_1) g_2(x_2)$.

I suspect that the only one solution is $f(x_1 x_2) = (x_1 x_2)^n$, $g_1(x_1) = x_1^n$, $g_1(x_2) = x_2^n$ where $n$ is some power. But I can't provide the proof that there are no other solutions.

Note that $g(a)g(b) = f(ab) = g(1) g(ab)$ for every $a,b$. We could have $g(1) = 0$, in which case we have the trivial solution $f(x)=g(x) = 0$ for all $x$. Otherwise, $h(x) = g(x)/g(1)$ satisfies $h(a) h(b) = h(ab)$ and $h(1) = 1$. Thus $h$ is a homomorphism of the multiplicative group of positive reals into the nonzero complex numbers. Besides the solutions $h(x) = x^p$ (for arbitrary complex $p$), corresponding to $g(x) = C x^p$ and $f(x) = C^2 x^p$, there are exotic non-measurable solutions.

I assume $f, g_1, g_2$ take values in the positive reals. If so, consider instead the functional equation $$f(x_1 + x_2) = g_1(x_1) + g_2(x_2)$$

where $f, g_1, g_2$ are functions from the reals to the reals. I claim that studying this functional equation is equivalent to studying the previous one; given any solution $f, g_1, g_2$ to this functional equation, the triple $$e^{f(\log x)}, e^{g_1(\log x)}, e^{g_2(\log x)}$$

is a solution to the previous functional equation, and conversely.

In the special case that $f = g_1 = g_2$, this functional equation is known as the Cauchy functional equation $$f(x + y) = f(x) + f(y).$$

The Cauchy functional equation is well-known to have "exotic" solutions besides the obvious solutions $f(x) = rx$; every solution comes from taking a Hamel basis of $\mathbb{R}$ as a vector space over $\mathbb{Q}$ (which exists conditional on the axiom of choice) and letting $f$ act arbitrarily on this basis.

In general, note that the space of solutions is a real vector space, and moreover it contains families of constant solutions $c = d + (d-c)$. By replacing $(f, g_1, g_2)$ with $(f - f(0), g_1 - g(0), g_2 - g(0))$, we may assume WLOG that $f(0) = g_1(0) = g_2(0) = 0$. Then $$g_1(x) = f(x + 0) = f(x) = f(0 + x) = g_2(x)$$

so we reduce to the Cauchy functional equation.