In mathematics, an inverse function is a function that "reverses" another function: if the function $f$ applied to an input $x$ gives a result of $y$, then applying its inverse function $g$ to $y$ gives the result $x$, and vice versa. i.e., $f(x) = y$ if and only if $g(y) = x$ , i'm interesting to check the relationship between multiplicative inverse function and the inverse compositional function ,Then my question here is related to the solution of the below functional equation

Question:

When does $ \displaystyle f^{-1}=\frac{1}{f}$ with $f$ a function mapping $\mathbb{R}^{*}$ to $\mathbb{R}$ and $f(x)\neq 0$ ?

Note:$f^{-1}$ is the compostional inverse of $f$ and $\displaystyle\frac{1}{f}$ is the multiplicative inverse of $f$

Edit:I have edited the question to define $f$ according to the answer below by Robert Israel.