[Math] Composition of Even and Odd Functions and their Outcome

functions

Give an example of an even function. Give an example of an odd function. If f(x) is
odd and g(x) is even, must f(g(x)) be even? Must g(f(x)) be even?

I've tried generic functions like

f(x) = x^3 and g(x) = x^2

Both compositions (going f(g(x)) and g(f(x)) yield even results)

However, when I use the trig functions, something different happens.

f(x) = sin(x) g(x) = cos(x)

f(g(x)) = even

and

g(f(x)) = even.

Therefore, can I assume, that the combination of any function (that is not neither odd nor even) will be even?

Best Answer

You can prove rules regarding composition of odd and even functions straight from the definitions. A function $f: \mathbb{R} \rightarrow \mathbb{R}$ is even if $f(-x)=f(x)$ for all $x$; it is odd if $f(-x)=-f(x)$ for all $x$. Now consider $f$ odd and $g$ even: $f\circ g(-x)=f(g(-x))=f(g(x)),$ since $g$ is even.

But, by definition, $f(g(x))=f\circ g(x)$, so $f \circ g$ is even.

A similar proof shows that $g \circ f$ is even.

It is certainly not true that the composition of any two functions will be even. Take $f$ defined by $f(x)=x+1$, and $g(x)=x+4$. Then $g\circ f(-x) = g(-x+4)=-x+5$, while $g \circ f(x)=x+5$.

As a notational aside, note that $f(x)$ is not a function, but rather the value of the function $f$ on a particular element $x$. A function from the real numbers to the real numbers is is a rule that assigns to each real number $x$ another number, which we write as $f(x)$. So it doesn't make sense to talk about the value $f(x)$ being odd or even -- being even and odd is a property of the rule, the function itself.

This is a common confusion, especially since it's common to refer to "the function $f(x)=x^2$" -- that is, to identify a function with a particular formula. It would be more precise to refer to "the $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(x)=x^2$ for all $x \in \mathbb{R}$," but as you can see it's more cumbersome.

Related Question