The problem asks to determine all functions defined and continuous over the set of reals that satisfy : $$|f(x)-\sin(x)|=|x|$$ for all reals $x$.
It's immediate that for any real $x$, we either have $f(x) = x + \sin(x)$ or $f(x)=-x+\sin(x)$. I wonder how continuity can help us finish in this case as for instance the IVT helps us to prove that the only continuous functions satisfying $(f(x))^2) = 1 $ for all reals are the two constant functions $ x \longmapsto 1$ and $x \longmapsto -1$.
Thanks for any ideas.
The only place you can switch between $\sin(x) - x$ and $\sin(x) + x$ while maintaining continuity is $x=0$. Thus there will be four solutions.
More formally, let $A = \{x: f(x) = \sin(x)-x\}$ and $B = \{x: f(x) = \sin(x) + x\}$. $A$ and $B$ are closed sets whose union is $\mathbb R$ and whose intersection is $\{0\}$. Use the fact that $(0,\infty)$ and $(-\infty, 0)$ are each connected.
Or if you want to use IVT: suppose $x, y > 0$ and $f(x) - \sin(x) = x > 0$ while $f(y) - \sin(y) = -y < 0$. IVT would say $f(z) - \sin(z) = 0$ for some $z$ between $x$ and $y$, which is impossible. Similarly if $x, y < 0$.