# Explaining why the absolute value of an odd function is even.

For the following:

If $f(x)$ is an odd function, then $|f(x)|$ is _____.

I said even, because I graphed an odd function and then the absolute value of it and ended up with an even function. The answer is correct but then my professor says this as an explanation:

$h(x)=|f(x)|$

$h(-x)=|f(-x)|=|-f(x)|=|f(x)|=h(x)$

He didn't explain very well and I don't know what is quite going on. I know this might be like a homework question but I would love to know what topic this is and what this process is. So I can look it up and figure it out.

EDIT: The process makes sense but what are we trying to prove here?

I will go through the last equation you wrote step-by-step and say why it is true. $$h(-x)=|f(-x)|$$ Since $h(x)=|f(x)|$, this follows immediately from the definition. $$|f(-x)|=|-f(x)|$$ This is because $f$ is an odd function and $f(-x)=-f(x)$ for all $x$. $$|-f(x)|=|f(x)|$$ By the definition of absolute value, $|y|=|-y|$ for all $y$ (absolute value is an even function). $$|f(x)|=h(x)$$ This is again, the definition of $h$.
The principle here is actually deeper. If $g(x)$ is an even function and $f(x)$ is an odd function, $g(f(x))$ is even and $f(g(x))$ is also even. Can you see how to prove these in the same way as above?
• By first statement do you mean $h(-x)=|f(-x)|$? – Alex S Jul 11 '15 at 1:17
• Since $h(x)$ is defined to be $|f(x)|$ for every value of $x$, if we just change $x$ to $-x$ on both sides, the equation is still true. – Alex S Jul 11 '15 at 1:28
• @Zephyr No, consider $f(x)=e^x$. Then $|f(x)|=|e^x|=e^x$, which is not an even function. $|f(x)|$ is only even if $f(-x)=\pm f(x)$ for each $x$. – Alex S Sep 28 '17 at 16:43
He was using the property of odd function: $$f(-x) = -f(x)$$ to prove that $h$ has the property of even function: $$h(-x) = h(x)$$