How can one find a bijection $ f $ from $ (0,\infty) $ into $ [0,1) $? How can one find a bijection $ f $ from $ (0,\infty) $ into $ [0,1) $? Can someone also please explain to me how to solve this kind of problem for any given interval?
 A: We can modify the function in @EliRose's comment to get a solution. First note that $f(x) = \frac{x}{x+1}$ maps from $(0,\infty)$ to $(0,1)$.
We'll make a new function $g(x)$ with the desired property. Start with $g(x) = f(x)$ for all $x$. We need to send a point to $0$; let's choose $g(1) = 0$. But now no point gets mapped to $f(1) = \frac12$. We can fix this by defining $g(2) = \frac12$. Continue in this way where for any positive integer $n$, $g(n)$ is mapped to $f(n-1)$.
Thus:
$$
g(x) = \begin{cases}
f(x-1), & \textrm{if $x \in \mathbb Z^+$}\\
f(x), & \textrm{otherwise}
\end{cases}$$
Now show that $g(x)$ is a bijection from $(0,\infty)$ to $[0,1)$.
A: Eli's function works as a bijection from $[0,\infty)$ to $[0,1)$. For $(0,\infty)$ to $[0,1)$, here's one example (albeit a not very natural one). Define $f \colon (0, \infty) \to [0,1)$ by
$$f(x) =  \left\{\def\arraystretch{1.0}
  \begin{array}{@{}c@{\quad}l@{}}
    \displaystyle\frac{2}{\pi}\arctan(x) & \text{if $x \not\in \mathbb{N}$}, \\
    \displaystyle\frac{2}{\pi}\arctan(n - 1) & \text{if $x \in \mathbb{N} \setminus \{1\}$}, \\
    0 & \text{if $x = 1$}.
  \end{array}\right.$$
The injectivity of $f$ follows from the injectivity of $\arctan$. To see that $(2/\pi)\arctan(n)$ is in the image of $f$ for each $n \in \mathbb{N}$, just take $f(n + 1)$. As $x \to \infty$, we have $(2/\pi)\arctan(x) \to 1$, and as $x \to 0^+$, we have $(2/\pi)\arctan(x) \to 0$. So the image of $f$ is $[0,1)$.
I'm not sure how to do this in general other than by splitting up the problem into many cases. Let $a,b,c,d \in \mathbb{R}$ with $a \neq b, c \neq d$. We have 
$$f(x) = \frac{d - c}{b - a}x + c - \frac{a(d - c)}{b - a}$$
is a bijection from $[a,b]$ to $[c,d]$, and also from $(a,b)$ to $(c,d)$. We have
$$f(x) = \frac{d - c}{\pi}\arctan(x) + d - \frac{d - c}{2}$$
is a bijection from $(-\infty, \infty)$ to $(c,d)$. We have
$$f(x) = \frac{d - c}{e^b}e^x + c$$
is a bijection from $(-\infty,b]$ to $(c,d]$.
You get the idea.
