[Math] Expressing every function as sum of an odd and an even function

calculusfunctions

If $f$ is to be written as a sum of the even function $E$ and the odd function $O$,
$E=\dfrac{f(x) + f(-x)}{2} \quad$ and
$O=\dfrac{f(x)-f(-x)}{2}$
obviously works.

I get a bit confused though because in a previous question I was asked to investigate if the sum of two functions $g$ and $h$ is even, odd or neither depending on if $g$ and $h$ is even or odd. I came to the conclusion that (with the subscript denoting if function is even or odd) $g_e(x) + h_o(x) $ is neither even nor odd assuming no function is the zero function:

$k(x) = g_e(x) + h_o(x) \implies k(-x) = g_e(-x) + h_o(-x) = g_e(x) – h_o(x) \quad$($k$ not even)
$k(x) = g_e(x) + h_o(x) \implies -k(-x) = -g_e(-x) – h_o(-x) = -g_e(x) + h_o(x)\quad$($k$ not odd)

So does the two facts:

1.) The sum of an even function $g_e$ and an odd function $h_o$ is neither even nor odd unless $g_e(x)=0$ or $h_o(x)=0$.

2.) Any function, even, odd or netheir, can be written as the sum of an even and an odd function.

mean that $E(x)=0$ or $O(x)=0$ if $f$ is even or odd?
Or am I just totally wrong about everything.

Best Answer

You are actually right. However, it would be better to add something to fact number 2:

Every function can be written uniquely as the sum of an even function and an odd function.

Another way to say the same thing (using linear algebra terminology) is: The vector space consisting of functions $\mathbb{R}\to\mathbb{R}$ is the direct sum of the space of even functions and the space of odd functions.