TITLE: How do you construct a function that is continuous over $(0,1)$ whose image is the entire real line?
QUESTION [11 upvotes]: How do you construct a continuous function over the interval $(0,1)$ whose image is the entire real line?
When I first saw this problem, I thought $\frac{1}{x(x-1)}$ might work since it is continuous on $(0,1)$, but when I graphed it, I saw that there is a minimum at $(1/2,4)$, so the image is $[4,\infty)$ and not $(-\infty,\infty)$.
Apparently, one answer to this question is:
$$\frac{2x-1}{x(x-1)}$$
But how is one supposed to arrive at this answer without using a  graphing calculator?

REPLY [5 votes]: This is a common question, often about a continuous function mapping $(-1,1)$ onto $\mathbb{R}$. For that setup, I have long enjoyed the Inverse Hyperbolic Tangent, $\tanh^{-1}$, as a function that does exactly the trick. However, the interval you begin with here is instead $(0,1)$, so to use this function would require first mapping $(0,1) \rightarrow (-1,1)$, which can be done via $x \mapsto 2x-1$.
And so that gives yet another answer: $x \mapsto \tanh^{-1}(2x-1)$ maps $(0,1)$ onto $\mathbb{R}$.

REPLY [2 votes]: Keeping in mind that (cumulative) distribution functions in statistics take the real line to the unit interval, inverse cdfs for variables defined over the whole real line are a rich and convenient source of these.
An example of this would be the $\log(\frac{x}{1-x})$, which is the inverse cdf for the standard logistic distribution (this particular one is sometimes called the logit function).
If you scroll to the bottom of the page at that link, you'll see a couple of dozen possibilities in the table at the bottom, mostly under "Continuous univariate supported on the whole real line". Some of those will not have convenient inverse cdfs, but a number of them do.
Once you have a few of them you can combine them with functions from the real line to the real line or the unit interval to the unit interval to get a very wide range of easily-obtained functions.