For which values of $a$ does this function has an inverse? I have the following function: $$f(x)=\begin{cases}
\frac{1-x}{x} & x\geq1\\
a-\arctan x & x<1
\end{cases}$$
and it is clear that the upper half is always invertible, so the only part we care about is the bottom part. It's inverse is $\tan(a-x),$ so it appears as if it always has an inverse, so why ask for which $a$ values? Did I make a mistake? How do you solve this?
 A: No, $f$ has NOT always an inverse.
You are not comparing the values of the function $f$ on both sides $(-\infty,1)$ and $[1,+\infty)$.
For instance, fora $a=0$, $f(1)=f(0)=0$ which means that $f$ is non injective in $\mathbb{R}$ and therefore it is not invertible. So invertibility DEPENDS on $a$!
Note that $f$ restricted to $[1,+\infty)$ and  $f$ restricted to $(-\infty,1)$ are strictly decreasing.
We have that
$$f([1,+\infty))=\left\{\frac{1}{x}-1\;:\; x\geq 1\right\}=(-1,0]$$
and
$$f((-\infty,1))=\{a-\arctan(x)\;:\; x<1\}=\left(a-\frac{\pi}{4},a+\frac{\pi}{2}\right).$$
In order to have invertibility such sets should be disjoint.
Why? Recall the definition of a bijective function and its inverse.
Can you take it from here?
A: $$f(x)=\begin{cases}
\frac{1-x}{x}& x\geq1 & f(1^+)=f(1)=0 \\
a-\arctan x & x<1 & f(1^-)=a-\frac{\pi}{4}
\end{cases}$$
so you need to $$a-\frac{\pi}{4}\geq f(1)$$it means $$a\geq\frac{\pi}{4}+0$$ it is becasus
$$f_1(x)=\frac{1-x}{x} \text{  decreasing  }    f'_1=-\frac1{x^2} <0    \space,\forall x>1\\
f_2(x)=a-arctanx \space\text{   decreasing   }f'_2=0-\frac1{1+x^2}<0 , \forall x<1$$
so the function can have inverse function at all
