I don't know how to find the inverse is of a function when is split. Example,
$\Bbb R_+$ is the set of positive real numbers. $f : \Bbb R \to \Bbb R_+$
$$f(x) = \begin{cases} 2-x & \text{if } x\leq 1\\ \frac{1}{x} & \text{if } x>1 \end{cases}$$
Can you guys tell me how to do it? I know how to find the inverse of each one, but how can I get the formula for $f^{-1}$? Any help is would be great.
The trick is to clearly identify the domains of the individual parts of the inverse functions. Consider the first function $2-x$. $f$ is equal to this on the domain $(-\infty,1]$. Where does $f$ map this? The function $-x$ maps this to $[-1,\infty)$, and so $2-x$ shifts this interval to $[1, \infty)$. Therefore the inverse function should map $f^{-1}$ to $(-\infty,1]$ and should be equal to the inverse function of $2-x$ on this interval. Thus $f^{-1}(y) = -y + 2$ on the interval $[1, \infty)$. Similarly, we can mimic the above process to find what $f^{-1}$ should be equal to on the other interval $(1, \infty).$