# The graph of inverse function $f^{-1}(y)$

Show that $f:I=(-1,1) \rightarrow \mathbb{R},$ it follows that $$f(x)=\begin{cases} \quad1-x & \text{ as } -1<x\leq 0, \\ \frac{{x}^{-1}+ \lfloor {x}^{-1}\rfloor}{1+{x}^{-1}+\lfloor {x}^{-1}\rfloor}& \text{ as } \quad0<x<1 , \end{cases}$$ and $\lfloor x\rfloor=$max{$n\in\mathbb{Z}$|$n\leq x$}.

We can proof the mapping $f:(-1,1) \rightarrow f(I)$is bijective,so let $f^{-1}$ is the inverse function of $f$ .

I want use $Mathematica$ to get $f^{-1}$,who can give me some details ? Any help from you will be greatly appreciated!

My effort:

• Welcome to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. – bbgodfrey Dec 30 '14 at 2:33
• @bbgodfrey:I will give my effort soon! – kiyosi Dec 30 '14 at 2:44
• ParametricPlot[{f[x], x}, {x, -1, 1 - 10^-9}, PlotRange -> {{.6, 2.05}, Automatic}, PlotPoints -> 200] – Bob Hanlon Dec 30 '14 at 2:54
• @Bob Hanlon:I need to get the graph of inverse function $f^{-1}(y)$,not the graph of $f(x).$ – kiyosi Dec 30 '14 at 3:08
• The plot of f[x] is the set of points {x, f[x]} over he domain; the inverse function is the set of points {f[x], x}. – Bob Hanlon Dec 30 '14 at 3:38

f[x_] = Piecewise[{
{1 - x, -1 < x <= 0},
{(1/x + Floor[1/x])/(1 + 1/x + Floor[1/x]),
0 < x < 1}}];

Plot[InverseFunction[f][y], {y, f[1. - 10^-9], f[-1. + 10^-9]},
PlotPoints -> 101,
AxesOrigin -> {.6, 0}]


ParametricPlot[{f[x], x},
{x, -1, 1 - 10^-9},
PlotRange -> {{.6, 2.05}, Automatic},
PlotPoints -> 200,
AspectRatio -> 1/GoldenRatio,
AxesOrigin -> {.6, 0}]


Note that the ParametricPlot is much faster.

There are a variety of ways to obtain an inverse. Here is a common one.

f[x_] := Piecewise[{{1 - x, -1 < x <=
0}, {(x^-1 + Abs[x^-1])/(1 + x^-1 + Abs[x^-1]), 0 < x <= 1}}];
Plot[f[x], {x, -1, 1}]


Its inverse, determine as described in the documentation to FindRoot

g[y_] := x /. FindRoot[f[x] - y, {x, 0}];
Plot[g[y], {y, 2/3, 2}]


• I want use InverseFunction[f] ,but I get mistake! thanks a lot! – kiyosi Dec 30 '14 at 3:16
• I misread your special symbol as Abs, not Floor. I shall have a corrected answer for you in a few minutes. – bbgodfrey Dec 30 '14 at 3:26
• :Many thanks! :) – kiyosi Dec 30 '14 at 3:30