# Differential equation changing sign almost everywhere

Conjecture: Let $f:\mathbb{R}→\mathbb{R}$ be an everywhere differentiable function and assume that $f(x)+f′(x)∈ \{-1,1\}$ almost everywhere and $f'(0)=0$. Then is $f$ necessarily a constant function?

Can you give me a counter-example? I have already asked the question here on MathSE.

Your conjecture is true and there is no counterexample.

Suppose, contrary to the above claim, that your conjecture is false. Define $$g(x) = f(x) + \int_0^x f(y) dy,$$ so that $g'(x) = f'(x) + f(x)$. Thus, $g$ is everywhere differentiable, $g'(x) \in \{-1,1\}$ almost everywhere, and $g'$ is not a constant. (For if $g'$ was constant $\pm 1$, we would have $f(x) = \pm 1 + c e^x$, which, together with $f'(0) = 0$, would imply that $f$ is constant).

This beautiful result of J.A. Clarkson from 1947 asserts that if $\alpha < \beta$, then $$E(\alpha, \beta) := \{x : g'(x) \in (\alpha, \beta)\}$$ is either empty or it has positive Lebesgue measure.

Since $g'$ is not constant, it takes at least two values, and by Darboux's theorem, in fact it takes all values in some interval $(\alpha, \beta)$. Changing this interval to a smaller one if necessary, we may assume that $(\alpha, \beta) \cap \{-1, 1\} = \varnothing$. Since $E(\alpha, \beta)$ is non-empty, it has positive Lebesgue measure, and therefore $g'(x)$ cannot belong to $\{-1, 1\}$ almost everywhere — a contradiction.

• @ Mateusz Kwaśnicki Thank you for ur answer and especially the result of J.A. Clarkson. I have a small remark about your reasoning, it does not explain the relevance of the hypothesis f '(0) = 0 because without it the conjecture is wrong Commented Jul 23, 2018 at 23:19
• The set $E(-1,1)+f(0)$ should be considered instead of $E(-1,1)$. This set is non empty because of your condition $f'(0)=0$, and not by virtue of Darboux's theorem. Commented Jul 24, 2018 at 2:21
• To avoid this problem, one can use a direct reasoning: With the result of J.A. Clarkson, one can prove if $g :\mathbb{R}→\mathbb{R}$ everywhere differentiable, and g′(x)∈{−1,1} almost everywhere then $g '$ must be constant. we apply it to $g = \int f + f$ and thus $g '= f + f'$ is constant ie $f + f '= 1$ everywhere or $f + f' = -1$everywhere and so $f (x) = ke ^ {- x} \pm 1$ but condition $f'(0)=0$ implie $k=0$ so f is the constant function 1 or the constant function -1 Commented Jul 24, 2018 at 8:44
• @onurcanbektas: I am sorry, I could not figure out which part of the proof is puzzling you. If $g'$ is constant everywhere, then $f(x) = \pm 1 + k e^x$ everywhere. Otherwise, $g'$ takes at least two values, and Clarkson's result allows us to conclude that $g'$ cannot belong to $\{-1, 1\}$ a.e. Commented Aug 13, 2018 at 22:46
• @MateuszKwaśnicki Ok, I was confused because I thought you were using the fact that it takes the values $-1,1$ almost everywhere somewhere else. Thanks for the response, by the way.
– Our
Commented Aug 14, 2018 at 7:17