Let $f:\mathbb{R}\rightarrow\mathbb{R}$ a function such that for any $b\in\mathbb{R}$ there exists a strictly decreasing sequence of real numbers $(a_n)_{n\geq1}$, with $$\lim_{n\to+\infty} a_n=b$$ such that $$|f(a_n)-f(b)|\leq a_n-b$$ a) If $f$ is continuous, prove that $|f(x)-f(y)|\leq |x-y|$ for any $x, y \in\mathbb{R}$
b)If $f$ isn't continuous, does the property from a) still hold?
The hypothesis is telling us that for any real point there exists the right limit and it is equal to the value of $f$ in that point, or in other words that $$f(x)=f(x+0)$$ for any $x$ real number, where $f(x+0)$ represents the right limit.
b) is not so hard, we can use, for example, the floor function and prove that the property doesn't hold anymore. Point a) is, however, a little bit trickier. I tried to prove that there is no $x_0$ and $y_0$ such that $$|f(x_0)-f(y_0)|>|x_0-y_0|$$ but I failed to show anything. What should be done?
Suppose that $f$ is continuous and that $x<y$ satisfy $|f(x) - f(y)| > |x - y|$. Consider the set
$$S=\{t \in \mathbb R\,:\,|f(x) - f(t)| > |x - t|\}.$$
Notice that $y\in S$.
Let $h(t) = |f(x) - f(t)| - |x - t|$. Then $h$ is continuous and $S = h^{-1}(0,+\infty)$, and hence $S$ is open. Let $a_n \downarrow y$ be as in the hypotheses. Can you find a contradiction?