A good day to everyone.
If $0 < x \in \mathbb{Q}$, $0 < y \in \mathbb{Q}$, $n \in {\mathbb{Z}}^{+} \cup \{0\}$, and $n$ is squarefree, then the function
$$y = f(x) = x + \frac{n}{x}$$
is not bijective, since there are two inverses, namely:
$$J(y) = x_1 = \frac{y - \sqrt{y^2 - 4n}}{2}$$
$$K(y) = x_2 = \frac{y + \sqrt{y^2 - 4n}}{2}$$
Consider the following expressions:
$$J^{-1}(J(y)) + K(K^{-1}(y)) = y + \frac{n}{y},$$
where the second term is valid if $n \geq y^2$.
Otherwise, the second term is
$$K(K^{-1}(y)) = y.$$
However, the following expression does not lend itself well to a (similarly) simple representation -- nonetheless, the resulting expressions for various $n \in {\mathbb{Z}}^{+} \cup \{0\}$ appear to be equally interesting:
$$J(J^{-1}(y)) = y, n = 0,$$ $$J(J^{-1}(y)) = \frac{1}{2}\left(x + \sqrt{{\left(x - \frac{1}{x}\right)}^2 - 4n} - \frac{n}{x}\right), n > 0.$$
On the other hand:
$$K^{-1}(K(y)) = y.$$
My question at this point would then be: To which specific domain(s) could I restrict the values of the arguments $0 < x \in \mathbb{Q}$ of the function $f$ so that $0 < y = f(x) = x + \frac{n}{x}$ becomes bijective (with inverse given by either $J$ or $K$)?
Thank you!
Following @ThomasAndrews' hint, $f$ becomes bijective by restricting it to any subset $S$ with $x\in S\implies \frac nx\notin S$. It is however not necessarily the case that either $J$ or $K$ can be taken as an inverse.
But: As $J$ is always the smaller and $K$ the bigger root, you can simply restrict $f$ to $(0,\sqrt n]\cap \mathbb Q$ with $J$ as inverse or to $[\sqrt n,\infty)\cap\mathbb Q$ with $K$ as inverse.