Let $\,f \colon \Bbb R \to \Bbb R$ be a continuous function such that $|f(x)-f(y)|\ge \frac12 |x-y|$ I am stuck on the following problem that says:

Let $\,f \colon \Bbb R \to \Bbb R$ be a continuous function such that $\,|f(x)-f(y)|\ge \frac12 |x-y|, \forall x,y \in \Bbb R$ . Then which of the following options is correct?

*

*$f$ is both one-to-one  and onto


*$f$ is one-to-one  but may not be onto


*$f$ is onto but may not be one-to-one


*$f$ is neither one-to-one nor onto

I do not know how to approach this particular problem even though I know about one-to-one and onto functions. Can someone explain? Thanks and regards to all.
 A: Another idea for the onto part. You can see immediately that $f$ is one to one (injective). You know that a continuous function which is injective is monotone. Suppose that the function is not onto. Then one of the limits $\lim_{x \to \pm\infty} f(x)$ exists and is finite. 
Suppose that $L=\lim_{x \to \infty}f(x)$ is finite (the same argument works if the other limit is finite). Then take $y$ arbitrary and $x \to \infty$ in the initial inequality and you'll get $|L-f(y)| \geq \infty$, contradiction.

Or you could work directly in the initial inequality. Fix $x_0 \in \Bbb{R}$ and let $y$ go to $\pm\infty$. Then $|f(y)-f(x_0)|$ goes to $+\infty$. This implies that both the limits in $\pm \infty$ are infinite, and the monotonicity implies that their sign is different. By the intermediate value theorem we conclude that the image of $f$ is $\Bbb{R}$ so $f$ is onto.
A: Suppose on the contrary, that $f$ is not one-to-one. Then there are two distinct $x$ and $y$ for which $f(x) = f(y)$, which is impossible given that $f(x) - f(y) \neq 0$.
Suppose $f$ is not onto. By continuity, it is either bounded above or below, and by the previous result it's either strictly increasing or strictly decreasing. Suppose it's increasing and bounded above, take a $x_0$ such that $f(x_0) > \sup_x f(x) - \delta$, then $f(x_0 + 2\delta) > \sup_x f(x)$ which is absurd. 
A: $f$ is $\DeclareMathOperator{\Ima}{Im}$ injective. Suppose $f(x) = f(y).$
$$0 = |f(x) - f(y)| \ge \frac12 |x - y| \implies x = y$$
We shall show that $f$ is also surjective.
Since $f$ is a continuous injection, it follows that $f$ is strictly monotonic. WLOG suppose that $f$ is strictly increasing.
Let $c = f(0)$ and let $y \in \mathbb{R}$. Let's show that $y \in \Ima f$.
If $y > c$, then $x_0 = 2(y - c) > 0$ so $f(0) \le f(x_0)$. We have:
$$f(x_0) - f(0) = |f(x_0) - f(0)| \ge \frac12 |x_0 - 0| = y - c$$
Hence $f(x_0) \ge y$ so $y \in \langle f(0), f(x_0)]$. Since $f$ is continuous, there exists a value $x_1 \in \langle 0, x_0]$ such that $f(x_1) = y$.
If $y < c$, then $x_0 = 2(y-c) < 0$ so $f(0) \ge f(x_0)$. We have:
$$f(0) - f(x_0) = |f(0) - f(x_0)| \ge \frac12 |0 -x_0| = c - y$$
Hence $f(x_0) \le y$ so $y \in [f(x_0), f(0)\rangle$. Since $f$ is continuous, there exists a value $x_2 \in \langle x_0, 0]$ such that $f(x_2) = y$.
If $y = c$, then $y = f(0)$.
In either case, $y \in \Ima f$.
We conclude that $f$ is surjective.
