# Determining when the composition of two functions is even or odd

A function is even $$\iff$$ $$f(-x) = f(x)$$ and odd $$\iff f(-x) = -f(x)$$.

If I have some function $$f$$ that is even and some function $$g$$ that is even, their composition is $$f(g(x))$$, right?

When I'm trying to find if this function is even or odd, isn't $$g(x)$$ technically the $$x$$ here? so, wouldn't I check $$f(-g(x))$$, or am I misunderstanding something?

Because I feel like I am, since I am getting different answers than I'm supposed to. But I'm not sure why exactly this isn't okay, because $$g(x)$$ is just the new variable in this case, is it not?

• $f\circ g$ is even if $f(g(-x))=f(g(x))$ and odd if $f(g(-x))=-f(g(x))$ Oct 1 at 5:52
• But why exactly is that the case? Because in general a function f is even if f(-x) = f(x) so from here it seems to just be minus the input, so if I have a composite function f(g(x)) isn't that f(-g(x))? minus the input? Because g(x) is the input here? Oct 1 at 6:03
• $g(x)$ is "the new variable" at an intermediate step of a computation of $f(g(x))$, but the "input" of $f\circ g$ in $(f\circ g)(x)$ is $x$. May be you will see it better if you name $h:=f\circ g$ and write the condition for $h$ to be even. Oct 1 at 6:18

If $$g$$ is odd and $$f$$ is even, then $$(f\circ g)(x)$$ is even.
$$f(g(-x)) = f(-g(x)) = f(g(x))$$

If $$g$$ is even, regardless of the function $$f$$, $$(f\circ g)(x)$$ is even.
$$f(g(-x)) = f(g(x))$$

If $$f$$ and $$g$$ are both odd, $$(f\circ g)(x)$$ is odd.
$$f(g(-x)) = f(-g(x)) = -f(g(x))$$

When in doubt, consider $$f(x) = x$$ as a simple example of an odd function and $$f(x) = x^2$$ as an example of an even function. While you can't prove a proposition is true by example, you can prove a proposition is false, and examples help build intuition.