Do functions over a ring have an odd and an even part

abstract-algebraeven-and-odd-functionsring-theory

All functions $f(x):\mathbb{R}\to\mathbb{R}$ can be decomposed into an even and an odd part $f(x)=E(x)+O(x)$.

The proof I see here, and on Wikipedia requires $2$ to have an inverse, however I want to know if this property is true of functions in a ring.

For a ring $R$ for every function $f(x):R\to R$, can I find even and odd functions $E(x)$ and $O(x)$ such that $f(x)=E(x)+O(x)$?

Using a similar method to the ordinary proof I can find that $2E(x)$ and $2O(x)$ are defined uniquely by $f$, but this only shows that $2f$ has a decomposition into an even and an odd part.
Because $2$ does not necessarily have an inverse, I'm not certain how to solve this.

I think that a decomposition seems possible, but it would not necessarily be unique?

Best Answer

It is not always possible to find such a decomposition.

If $f(x)=E(x)+O(x)$ where $E$ is even and $O$ is odd, then $f(x)+f(-x)=2E(x)$ is always divisible by $2$. So for instance if $R=\mathbb{Z}$ then this is not possible for any function with $f(1)=0$ and $f(-1)=1$.

On the other hand, if $2=0$ in $R$, then every function is both even and odd, so such decompositions are not unique (assuming $R$ has more than one element).