How do you construct a function that is continuous over $(0,1)$ whose image is the entire real line? 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?

Here's another example. Take the continuous function $f:(0,1)\to\mathbb R$ defined by $$f(x)=\frac{1}{x}\cos\frac{\pi}x.$$ For $n\in\mathbb N$ we have $f(\frac1{2n})=2n$ and $f(\frac1{2n+1})=-2n-1$, so $[-2n-1,2n]$ lies in the image of $f$ for each $n\in\mathbb N$. Therefore, the image of $f$ is $\mathbb R$.
This example has the further property that $\lim_{x\to1}f(x)=-1\in\mathbb R$ exists. (So $f$ can be extended to yield a surjection from $(0,1]$ onto $\mathbb R$.)
