Proving an unspecified function is both one-to-one and onto Suppose $f : \mathbb{R} \rightarrow \mathbb{R}$ is continuous. Moreover, suppose for every $(x, y) \in \mathbb{R} \times \mathbb{R}$, we have 
$$|f(x) - f(y)| \geq c|x - y|$$
for some positive constant $c > 0$. 
(a) Show that $f$ is one-to-one
(b) Show that $f$ is onto.

(a) Suppose for contradiction there are $x, y \in \mathbb{R}$ with $x \neq y$ such that $f(x) = f(y)$. Then, we have 
$$|f(x) - f(y)| = 0 \geq c|x - y|,$$ which is clearly a contradiction because $c > 0$. Hence, we must have $x = y$ in order to enforce $|x - y| = 0.$

Now, how can I prove that $f$ is onto? My guess is that I'm going to need to use the fact that $f$ is continuous because I haven't used that fact yet. I have been messing around with $\epsilon$-$\delta$ definition of continuity, yet I can't get anywhere.
 A: $\ \ \ \ \ $ First we can note that $f(x)$ must be either strictly increasing or strictly decreasing. If this was not the case, we would have some $x,y,z$ such that $y <x < z$ and $f(y) < f(x)$ and $f(z) < f(x)$ (or we could have the inequalities reversed, the argument is the same in either case). Pick $b$ such that $ f(y),f(z) < b < f(x)$ so by the intermediate value theorem we have $a_1, a_2$ where $y < a_1 < x$ and $x < a_2 < z$ and $f(a_1) = f(a_2) = b$, contradicting the one-to-one property of the function.
$\ \ \ \ \ $ Next we can note the function is unbounded by taking $x = y+1$ so that $|f(y+1) - f(y)| \geq c$ and since $f(y+1) - f(y)$ always has the same sign for all $y$ by its monotonicity, we have $\sum_{i=1}^n |y(i+1)-y(i)| = \pm \sum_{i=1}^n (y(i+1)-y(i)) = 
 \pm (y(n+1) - y(1))$ so that $\pm(y(n+1) -y(1)) \geq cn$. Depending on whether the function is monotonic increasing or decreasing in one direction we will go to $+\infty$, in the other to $-\infty$, and so by the intermediate value theorem this function must be onto.
A: You've done well with showing that $f$ is one-to-one, though it could be simpler. Note that if $x\ne y,$ then $|x-y|>0,$ so $$\bigl|f(x)-f(y)\bigr|\ge c|x-y|>0,$$ and so $f(x)\ne f(y).$
To show that $f$ is onto, I would proceed as follows:


*

*Show that continuous, one-to-one functions $\Bbb R\to\Bbb R$ are either strictly increasing or strictly decreasing. (Intermediate value theorem is key, here.)

*Show that the function $g(x):=\bigl|f(x)-f(0)\bigr|$ is unbounded above.

*Conclude that $f$ is unbounded both above and below.

*Use intermediate value theorem to complete the proof.

