Function with domain all real numbers and range $(0,1)$ 
Is there a one-to-one function whose domain is all real numbers and range is $(0,1)$? 

I can't find any so I was thinking about trying to find a piece-wise function that meets the requirements, but I'm having a lot of trouble doing that too. 
This is a part of the problem I'm trying to solve to show that two sets have the same cardinality. 
Any help is appreciated!
 A: The logistic function satisfies those requirements:
$$ f(x) = \frac{\exp(x)}{1+\exp(x)} $$
A: Hint:
find $a,b$ in $y=a \arctan (x) +b$ so the your condition is satisfied.
A: Consider $(0,1)\to (-1, 1)$ by $f(0,1) \to (-1,1):f(x) = 2x - 1$.
Now stretch $-1\mapsto -\infty$, $0\mapsto 0$, $1\mapsto \infty$ by .... how? Well as $x\to 0$ we have $\frac 1x \to \infty$ so $x\to 1^-$ we have $\frac 1{x-1}\to \infty$. But $\frac 1{x-1}$ will map $0\to 1$.  But we can do $g[0,1)\to [0,\infty):g(x) =\frac 1{x-1}-1$.
And we do the same for the negative values $h:(-1, 0]\mapsto (-\infty, 0]: h(x)=\frac 1{x+1}+1$.
So we have $G: (0,1)\to \mathbb R$ via $G(x)=\begin{cases}\frac 1{(2x-1)-1}-1&x\ge \frac 12\\\frac 1{(2x-1)+1}&x < \frac 12\end{cases}=\begin{cases}\frac 1{2x-2}-1&x\ge \frac 12\\\frac 1{2x}+1&x < \frac 12\end{cases}$
And so $G^{-1}\mathbb R\to (0,1)$ can be $\begin{cases} \frac 1{2(y+1)} + 1&x \ge 0\\\frac 1{2(y+1)}&x < 0\end{cases}$ will do it.
....
But there are better functions.
You shouldn't think to hard about these.  You should realize the must be possible so then just draw pictures and figure it out.
A better function is to note $\tan: (-\frac {\pi}2, \frac {\pi}2) \to \mathbb R$.
So $\arctan: \mathbb R \to (-\frac {\pi}2,\frac {\pi}2)$.
And $\frac 2{\pi}\arctan x: \mathbb R \to (-1, 1)$.
And $\frac {\frac 2{\pi}\arctan x + 2}2: \mathbb R \to (0,1)$.
A: For each $n \in \mathbb N$ (including $0$) let $f_n \colon [n, n+1] \to \mathbb R$ be unique polynomial of degree $1$ such that $f_n(n) = 1- \frac{1}{n}$ and $f_n(n+1) = 1 - \frac{1}{n+1}$. $(\dagger)$
Then $f := \bigcup_{n \in \mathbb N} f_n \colon [0, \infty) \to [0,1)$ is injective.
Figure out how to extend $f$ on $(- \infty, 0]$ to an injective function $g \colon \mathbb R \to (-1,1)$ and then consider the injective function
$$
h \colon \mathbb R \to (0,1), x \mapsto \frac{g(x) +1}{2}.
$$

$(\dagger)$ $f_n$ is essentially a line segment with smaller and smaller inclination as $n$ tends towards $\infty$.
