Given $f(x)=x+[x]$ where $$f:\Bbb{R}\to\bigcup_{n\in \Bbb > Z}[2n,2n+1)$$
Find $f^{-1}(x)$ ?
My Attempt:
$y=x+[x]=2[x]+\{x\}\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ $Since $x=[x]+\{x\}$
$\Rightarrow y-\{x\}=2[x]$
The above equation implies $y-\{x\}$ is an integer, therefore it can be written as $y-\{y\}$.Hence, it implies $\{x\}=\{y\}.$
$\Rightarrow y-\{y\}=2[x]$
$\Rightarrow [x]=\frac{[y]}{2}$
Adding {x} both sides we get,
$\Rightarrow [x]+\{x\}=\frac{[y]}{2}+\{x\}$
$\Rightarrow x=\frac{[y]}{2}+\{y\}=y-\frac{[y]}{2}$
Hence,
$$f^{-1}(x)=x-\frac{[x]}{2}$$
What are some other ways to solve this problem and to find inverses of such type of function ?
In the above context, $[x]$ is Greatest Integer Function(floor) and $\{x\}$ is fractional part of $x$.
Another way: \begin{eqnarray} y &=& x+[x] \\ x &=& y-[x] ~~;~~(1)\\ y &=& x+[x] ~~;~~(From~main~function) \\ y &=& x+[y-[x]] ~~;~~From(1)\\ y &=& x+[y]-[x] \\ y &=& x+[y]-(y-x) \\ y &=& x+[y]-y+x \\ 2y &=& 2x+[y] \\ x &=& \frac12(2y-[y]) \\ x &=& y-\frac{[y]}{2} \end{eqnarray}