TITLE: Are continuous functions almost completely determined by their modulus of continuity?
QUESTION [16 upvotes]: Given a function $f: \mathbb{R}\to\mathbb{R}$, we define its left modulus of continuity, $L(f): \mathbb{R} \times (0, \infty)\to [0,\infty]$ by
$$L(f)(x, e) := \sup \{d \ge 0 \,:\, f((x, x+d)) \subseteq [f(x) - e, f(x) + e]\} $$
Similarly define the right modulus of continuity, 
$R(f): \mathbb{R} \times (0, \infty)\to [0,\infty]$ by
$$R(f) (x, e) := \sup \{d \ge 0 \,:\, f((x-d, x)) \subseteq [f(x) - e, f(x) + e]\}$$
Suppose $f$ and $g$ are continuous functions such that $L(f) = L(g)$, $R(f) = R(g)$, and $f(0) = g(0) = 0$. Does it follow that either $f = g$ or $f = -g$?

REPLY [6 votes]: I think they are. Assume the contrary, then $f$ is not constant and therefore there exists a point $a$ such that $f$ is not constant neither on $[a,+\infty)$ nor on $(-\infty,a]$. Call such points admissible. The admissible points form an interval (possibly infinite). Without loss of generality $0$ is admissible point (else shift the argument and subtract the constant from $f$.)
Denote $L(f)(0,e)=A(e)$, $R(f)(0,e)=B(e)$. Clearly $A$ is decreasing function on $(0,\infty)$ and $|f(A(e))|=e$ (if $A(e)<\infty$), $|f|<e$ on $[0,A(e))$. The same holds for $g$, thus $g(A(e))=\pm f(A(e))$. I claim that the sign does not depend on $e$. Indeed, choose $e_1>0$ such that $B(e_1)<\infty$. Then analogously $f(-B(e_1))=\pm e_1, g(-B(e_1))=\pm e_1$. I claim that ${\rm sign}\, f(-B(e_1))/g(-B(e_1))={\rm sign}\, f(A(e))/g(A(e))$ for any positive $e$. Indeed, in the opposite case exactly one of the numbers $L(f)(-B(e_1),e+e_1)$, $L(g)(-B(e_1),e+e_1)$ equals to $B(e_1)+A(e)$. A contradiction. So, the sign is always the same. 
We say that $0$ is a plus-point if this sign is always plus and 0 is minus-point if the sign is always minus. Analogously, any admissible point $a$ is a plus-point or minus-point. The next claim is that either all admissible points are plus-points or all of them are minus-points. It suffices to show that both sets of plus-points and minus-points are open. Assume the contrary: for example, 0 is a plus-point but there exists a sequence of minus-points $t_n\to 0$. Fix $e>0$  such that $A(e)>0$ and $A$ is continuous at $e$. This continuity yields that whenever $|f(s_n)| \to e$ or  $|g(s_n)| \to e$ for a sequence $s_n\in [0,A(e)]$, we must have $s_n\to A(e)$. 
Assume without loss of generality that $f(A(e))=g(A(e))=e$. Denote $b_n=L(f)(t_n,e-f(t_n))$. Then $t_n+b_n\leqslant A(e)$ and $f(t_n+b_n)=f(t_n)\pm (e-f(t_n))$, $g(t_n+b_n)=g(t_n)\mp (e-f(t_n))$ with opposite sign. In any case we have $|f(b_n+t_n)|\to e$, thus by aforementioned corollary of continuity of $A$ at $e$ we get $b_n\to A(e)$, but then one of functions $f, g$ becomes discontinuous at $A(e)$. 
Now assume that all admissible points are plus-points but there exist points for which $f\ne g$. Denote by $\Omega$ the open set of admissible points for which $f\ne g$. $\Omega$ is non-empty but $0\notin \Omega$. Therefore $\Omega$ has a connected component $(\alpha,\beta)$ with $\alpha$ or $\beta$ admissible. Without loss of generality $\alpha=0$. Then for small $e$ we do not have $f(A(e))=g(A(e))$. A contradiction.