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$?



Are continuous functions almost completely determined by their modulus of continuity?
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.


