# Does $f+g$ differentiable imply both $f$ and $g$ differentiable too?

Let $f,g:\Bbb R\to\Bbb R$ be real variable continuous functions and define $h:=f+g$; suppose $h$ non-constant.

If $h$ is differentiable at some $x_0\in\Bbb R$, does the same holds for both $f$ and $g$? Or there exist a couple of functions $f,g$ not differentiable at $x_0$ such that their sum does?

Maybe is trivial but I can't find counterexamples.

In what case is this true?

• What if you take $g$ to be $-f$? – Lord Shark the Unknown Oct 4 '17 at 19:25
• $g = -f$ where $f$ is whatever mess you want. – user296602 Oct 4 '17 at 19:25
• Ok, that is trivial; any other counterexample? – Joe Oct 4 '17 at 19:27
• Let $h$ be a differentiable function, $f$ be literally any non-differentiable function, and $g := h-f$. – Dustan Levenstein Oct 4 '17 at 19:28

As others have pointed out, if you allow $f$ and $g$ to be any continuous functions, then knowing that $f+g$ is differentiable will tell you nothing about the differentiability of $f$ and $g$.
If you know that $f + g$ is differentiable and you assume that $f$ is also differentiable while making no assumptions at all on $g$, then $g$ will also be differentiable. (because $g= (f+g) - f$ and differences of diffentiable functions are differentiable.)
If $ab>0$ are $a$ and $b$ positive?
If $a+b$ is a multiple of $3$, then both $a$ and $b$ are?
If $x,y$ are real and $x+y$ are rational, then are $x$ and $y$ rational?