. Find all functions $f: \mathbb{Q}_{>0} \rightarrow \mathbb{Z}_{>0}$ such that

$$
f(x y) \cdot \operatorname{gcd}\left(f(x) f(y), f\left(\frac{1}{x}\right) f\left(\frac{1}{y}\right)\right)=x y f\left(\frac{1}{x}\right) f\left(\frac{1}{y}\right)
$$

for all $x, y \in \mathbb{Q}_{>0}$, where $\operatorname{gcd}(a, b)$ denotes the greatest common divisor of $a$ and $b$.
Let $f: \mathbb{Q}_{>0} \rightarrow \mathbb{Z}_{>0}$ be a function satisfying

$$
f(x y) \cdot \operatorname{gcd}\left(f(x) f(y), f\left(\frac{1}{x}\right) f\left(\frac{1}{y}\right)\right)=x y f\left(\frac{1}{x}\right) f\left(\frac{1}{y}\right)
$$

for all $x, y \in \mathbb{Q}_{>0}$. Taking $y=\frac{1}{x}$ in (1), we obtain

$$
f(1) \cdot \operatorname{gcd}\left(f(x) f\left(\frac{1}{x}\right), f\left(\frac{1}{x}\right) f(x)\right)=f\left(\frac{1}{x}\right) f(x),
$$

which directly implies that $f(1)=1$. Now if we take $y=1$ in (1), we get

$$
f(x) \cdot \operatorname{gcd}\left(f(x), f\left(\frac{1}{x}\right)\right)=x f\left(\frac{1}{x}\right) .
$$

Replacing $x$ with $\frac{1}{x}$ in the latter equation, we also get

$$
f\left(\frac{1}{x}\right) \cdot \operatorname{gcd}\left(f\left(\frac{1}{x}\right), f(x)\right)=\frac{1}{x} f(x) .
$$

Comparing (2) and (3), we deduce that

$$
f(x)^{2}=x^{2} f\left(\frac{1}{x}\right)^{2}
$$

which can be rewritten as

$$
f(x)=x f\left(\frac{1}{x}\right)
$$

for all $x \in \mathbb{Q}_{>0}$. We can therefore replace $f(x)$ with $x f\left(\frac{1}{x}\right)$ in (2), and this gives us

$$
\operatorname{gcd}\left(x f\left(\frac{1}{x}\right), f\left(\frac{1}{x}\right)\right)=1
$$

When $x \in \mathbb{Z}_{>0}$, the greatest common divisor of $x f\left(\frac{1}{x}\right)$ and $f\left(\frac{1}{x}\right)$ is $f\left(\frac{1}{x}\right)$, so that we find

$$
f\left(\frac{1}{x}\right)=1 \quad \text { for all } x \in \mathbb{Z}_{>0}
$$

Using (4), we then also get that

$$
f(x)=x \quad \text { for all } x \in \mathbb{Z}_{>0} .
$$

Finally, given a positive rational number $q=\frac{m}{n}$ with $m, n \in \mathbb{Z}_{>0}$, we can find the value of $f\left(\frac{m}{n}\right)$ by taking $x=m$ and $y=\frac{1}{n}$ in the initial equation (1):

$$
f\left(\frac{m}{n}\right)=\frac{m}{\operatorname{gcd}(m, n)}
$$

If $m$ and $n$ are chosen to be coprime, then we obtain the nice formula

$$
f\left(\frac{m}{n}\right)=m \quad \text { for all } m, n \in \mathbb{Z}_{>0} \text { such that } \operatorname{gcd}(m, n)=1
$$

So the only function $f: \mathbb{Q}_{>0} \rightarrow \mathbb{Z}_{>0}$ that can possibly satisfy the statement is the function defined by (7). We claim that this function indeed satisfies the statement. Indeed, if we write $x=\frac{a}{b}$ and $y=\frac{c}{d}$ with $\operatorname{gcd}(a, b)=1$ and $\operatorname{gcd}(c, d)=1$ in (1), we obtain the equality

$$
f\left(\frac{a c}{b d}\right) \cdot \operatorname{gcd}(a c, b d)=a c,
$$

which is true since

$$
f\left(\frac{a c}{b d}\right)=f\left(\frac{\frac{a c}{\operatorname{gcd}(a c, b d)}}{\frac{b d}{\operatorname{gcd}(a c, b d)}}\right)=\frac{a c}{\operatorname{gcd}(a c, b d)} .
$$