# If $f \circ f$ is odd, then is so $f$?

It is straightforward to see that $$f \circ f$$ is odd whenever $$f$$ is odd. Indeed, assuming $$f(-x) = -f(x)$$ for all $$x$$, we get

$$f(f(-x)) = f(-f(x)) = -f(f(x)).$$

Hence, $$f \circ f$$ is an odd function as well.

My question is a converse of the above statement.

Suppose $$f : \mathbb{R} \to \mathbb{R}$$ is continuous. If $$f \circ f$$ is an odd function. What can I say about $$f$$ itself? Is it odd?

Define $$f(x)=\begin{cases}0&x\leq0\\-x&x>0\end{cases}$$.
Then $$f(f(-x))=-f(f(x))=0$$ but $$f(-x)\neq-f(x)$$, except at $$x=0$$. Hence we have an odd $$f(f(x))$$ which doesn't imply an odd $$f(x)$$.
Note that $$f(f(x))$$ is in fact both even and odd. This answer was inspired in part by user @Henry_Lee.
• That is a clever counterexample. If we replace $-x$ to $-x^2$ in the definition of $f$, then even differentiability of $f$ doesn't imply the converse statement. Thanks! Oct 9, 2018 at 18:43
• @JuyoungJeong Thanks and good point. We could even have $f(x)=\begin{cases}0&x\leq0\\-e^{-1/x}&x>0\end{cases}$ to have $f(x)$ smooth.