how to prove, $f$ is onto if $f$ is continuous and satisfying $|f(x) - f(y)| ≥ |x - y|$ for all $x,y$ in $\mathbb{R}$
Hint:
The given inequality implies that $f$ must be one-to-one. Without loss of generality, suppose $f$ is increasing.
Suppose now that $f$ does not take the value $M>f(0)$ with $M$ positive. Then by continuity we must have $|f(x)-f(0)|\le M-f(0)$ for all $x\ge 0$. This, however, contradicts your given inequality (consider the inequality with $y=0$ and $x>M-f(0)$). Thus, $f$ is not bounded above.
Now argue in a manner similar to the above that $f$ is not bounded below.
So, you have a continuous function which is neither bounded above nor bounded below...
Let $A=f(\mathbb R)$. The inequality implies that $f$ is injective with continuous inverse defined on $A$, hence by assumed continuity of $f$, $f:\mathbb R\to A$ is a homeomorphism. The inequality along with continuity of $f$ and completeness of $\mathbb R$ also implies that $A$ is complete with the metric restricted from $\mathbb R$. The only subspace of $\mathbb R$ that is homeomorphic to $\mathbb R$ and complete (with the restricted metric) is $\mathbb R$, so $A=\mathbb R$.
If $M$ is connected and $f$ is continuous, then $f(M)$ is connected. $\mathbb{R}$ is connected. Hence $f(\mathbb{R})$ must be an interval. Now you only have to prove that $f(\mathbb{R})$ cannot be bounded from above or below. That's up to you.