Surjectivity of a piecewise function $f:(-1,1)\to \mathbb R$ Function $f$ is defined as $f: (-1, 1) \to \mathbb{R}$.
$$
  f(x) = \begin{cases}
-x/(x-1),&x\geq 0
\\
x/(x+1),&x \leq 0
\end{cases}
$$
Let $y \in \mathbb{R}$. How would I prove that there exists a   $x\in (-1, 1)$ such  that $f(x) = y$?
 A: Note that if $x \geq 0$, then $f(x) \geq 0$, and if $x\leq 0$, then $f(x) \leq 0$ as well. So let's split this into two parts:


*

*$y \geq 0$. In that case, take $x/(1-x) = y \Leftrightarrow x = y/(1+y)$. Note that $x\geq0$ and $x < 1$ in this case, so this choice works.

*$y < 0$. In this case, take $x/(1+x) = y \Leftrightarrow x = y/(1-y)$. Note that $x < 0$ and $x > -1$ in this case, so this choice works.
Basically, you would have to split the range of the function into several sets, where each piecewise function's range corresponds to the partition.
A: Let me guide you through how I would approach this sort of problem.
First you have to test the water. Try some positive and negative numbers and see where they are mapped to.
$$f\left(\frac12\right)=\frac{\frac12}{\frac12}=1\\
f\left(-\frac12\right)=\frac{-\frac12}{\frac12}=-1$$
Okay, that's a bit "too" well-behaved, let's try $\pm\frac1\pi$ instead.
$$f\left(\frac1\pi\right)=\frac{\frac1\pi}{\frac{\pi-1}{\pi}}=\frac1{\pi-1}\\
f\left(-\frac1\pi\right)=\frac{-\frac1\pi}{\frac{\pi-1}{\pi}}=-\frac1{\pi-1}$$
Okay, that gives us sort of a clue here. We need to separate the cases if $y<0$ and if $y>0$, and of course the $y=0$ case as well.
If $y=0$ then $f(0)=0$ and we're done.
So now suppose $y>0$, then write $y=\frac x{1-x}$ then $x=y(1-x)=y-xy$, and therefore $x+xy=y=x(1+y)$ which means $x=\frac y{1+y}$.
Do the same for $y<0$, and you're about done. You may want to clean this up a bit, of course.
