While working on a proof showing that all functions limited to the domain of real numbers can be expressed as a sum of their odd and even components, I stumbled into a troublesome roadblock; namely, I had no clue how one divides the function into these even and odd parts.
Looking up a solution for the proof, I found these general formulas for the even and odd parts of a function $f(n)$:
$$\begin{align*} f_e(n)&\overset{\Delta}{=}\frac{f(n)+f(-n)}{2}\\ f_o(n)&\overset{\Delta}{=}\frac{f(n)-f(-n)}{2} \end{align*}$$
While I understand that in an even function $f(n) = f(-n)$ and that in an odd function $f(-n) = -f(n)$, I still don't get how these general formulas for the even and odd parts were obtained. Can someone guide me through the logic?