[In mathematics](https://en.wikipedia.org/wiki/Inverse_function), 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.
> > 
> > 
> > 
> 
> 
> 



When does $f^{-1}=\frac{1}{f}$ with $f$ a function mapping $\mathbb{R}^{*}$ to $\mathbb{R}$?
You can't have $f^{-1}(x) = 1/f(x)$ with both sides defined for all $x \in \mathbb R$. Namely, if $t = f^{-1}(0)$ then $f^{-1}(t) = 1/f(t) = 1/0$ is undefined.


EDIT:
With the correction that $f$ maps $\mathbb R^\* = \mathbb R \backslash \{0\}$ to itself, here is one class of solutions. Take any $f\_0$ that maps $(0,1]$ one-to-one onto $(-\infty,-1]$ with $f\_0(1) = -1$. Then let
$$ f(x) = \cases{f\_0(x) & if $x \in (0,1]$\cr
 1/f\_0(1/x) & if $x \in (1,\infty)$\cr
 f\_0^{-1}(1/x) & if $x \in (-1,0)$\cr
 1/f\_0^{-1}(x) & if $x \in (-\infty,-1]$\cr} $$


