Prove that every function f continuous on $\mathbb{R}$ can be written as $f=E+O$, where $E$ is even and continuous and $O$ is odd and continuous. I have been asked to prove the following in my Real Analysis class:
Prove that every function $f$ continuous on $\mathbb{R}$ can be written as $f=E+O$, where $E$ is even and continuous and $O$ is odd and continuous. 
I am not quite sure where to begin. 
Thanks!
 A: We have that a function $g : \mathbb{R} \to \mathbb{R}$ is:


*

*even when $\color{blue}{g(-x) = g(x)}$, for all $x \in \mathbb{R}$;

*odd when $\color{red}{g(-x) = -g(x)}$, for all $x \in \mathbb{R}$.


Suppose a function $f$ can be written as the sum of an even function $E$ and an odd function $O$, so:
$$f(x) = \color{blue}{E(x)}+\color{red}{O(x)} \tag{1}$$
Then we also have:
$$\begin{align}f(-x) & = \color{blue}{E(-x)}+\color{red}{O(-x)} \\[3pt]
 & =  \color{blue}{E(x)}\color{red}{-O(x)} \tag{2} \end{align}$$
Now add and subtract equations $\rm (1)$ and $\rm (2)$ to express $E$ and $O$ in terms of $f$.
Notes:


*

*Since sums and differences of continuous functions remain continuous, the functions $E$ and $O$ constructed from $f$ will be continuous provided that $f$ is (which it is, by assumption).

*Although we assume that $f$ can be written in such a way, this only gives us an elegant way to come up with the correct formula(s). We can then easily verify that with these formulas, it is always possible to decompose $f$ into an even and an odd part.

A: Let $y=f(x)$ be a continuous function. We define:
$g(x)=\dfrac{1}{2}[f(x)+f(-x)]\rightarrow$ $g$ is even and continuous.
$h(x)=\dfrac{1}{2}[f(x)-f(-x)]\rightarrow$ $h$ is odd and continuous.
$$f(x)=g(x)+h(x)$$
