Problem: Let $\mathbb{F} $ be a field and $V = \left\{ f:\mathbb{R} \to \mathbb{F} \right\} $ be the vector space of all functions. Let $W_\text{even},W_{\text{odd}} \subseteq V$ denotes the set of all even and odd functions respectively. Prove that $W_{\text{even}}$ and $W_{\text{odd}}$ are vector space over $\mathbb{F} $. Moreover, show that \[ V = W_{\text{even}} \oplus W_{\text{odd}}. \]
Solution: We will first show that $W_{\text{even}}$ and $W_{\text{odd}}$ are vector subspaces of $V$. Recall that $W$ is a vector subspace of $V$ if for any $w_1,w_2\in W$ and $\alpha \in \mathbb{F} $, we have $\alpha w_1 + w_2\in W$.
Let $f_1,f_2\in W_{\text{even}}$ and $\alpha \in \mathbb{F} $ be given. We need to show that $\alpha f_1+f_2$ is an even function. Note that $f_1$ and $f_2$ are even functions, so \[ f_1(-x) = f_1(x) \text{ and } f_2(-x) = f_2(x). \] Observe that \begin{align*} \left( \alpha f_1+f_2 \right) (-x) & = \left( \alpha f_1 \right) (-x) + f_2(-x) \\ & = \alpha f_1(-x) + f_2(x) \\ & = \alpha f_1(x) + f_2(x) \\ & = \left( \alpha f_1+f_2 \right) (x). \end{align*} Thus, $\alpha f_1+f_2\in W_{\text{even}}$.
Similarly, if $f_1,f_2$ are odd functions, we have \[ f_1(-x) = -x, \text{ and } f_2(-x) = -f_2(x). \] So, for any $\alpha \in \mathbb{F} $, \begin{align*} \left( \alpha f_1+f_2 \right) (-x) & = \left( \alpha f_1 \right) (-x) + f_2(-x) \\ & = \alpha f_1(-x) - f_2(x) \\ & = -\alpha f_1(x) - f_2(x) \\ & = -\left( \alpha f_1+f_2 \right) (x). \end{align*} Thus, $\alpha f_1+f_2\in W_{\text{odd}}$.
Now we will show that $V= W_{\text{even}} \oplus W_{\text{odd}} $. If $f\in V$, then note that \begin{align*} g(x) & = \frac{f(x) + f(-x)}{2} \in W_{\text{even}},~\text{and } \\ h(x) & = \frac{f(x) - f(-x)}{2} \in W_{\text{odd}}. \end{align*} For that, \begin{align*} & g(-x) = \frac{f(-x)+f(-(-x))}{2} = \frac{f(-x)+f(x)}{2}= g(x) \\ & h(-x) = \frac{f(-x)-f(-(-x))}{2} = \frac{f(-x)-f(x)}{2}= -h(x). \end{align*} Now observe that \[ f(x) = g(x) + h(x). \] Thus, we showed that $V = W_{\text{even}} + W_{\text{odd}}$. Now to show it is a direct sum, we need to show that $W_{\text{even}} \cap W_{\text{odd}} = \{0\}$. If $f\in W_{\text{even}}\cap W_{\text{odd}}$, then for any $x\in \mathbb{R} $, \begin{align*} -f(x) = f(-x) = f(x) \implies f(x) +f(x) = 0 \implies f(x) = 0. \end{align*} Since, $f(x)=0$ for every $x\in \mathbb{R} $, so $f\equiv 0$. Thus, we proved that \[ V = W_{\text{even}} \oplus W_{\text{odd}}. \]