Is the following statement true? In case not, what's a counterexample? Thank you.
If $f,g: \mathbb R \to \mathbb R$ are two continuous functions satisfying $f \circ g = g \circ f$, then either $f$ is linear or $g$ is linear (Where neither $f$ nor $g$ is invertible and $f \neq g$).
Def: $f : \mathbb R \to \mathbb R$ is said to be linear if, there exists $a \in \mathbb R$ such that $f(x) = ax$ for all $x \in \mathbb R$.
A contradiction can be easily obtained by letting $f=g$ without $f$ being linear.
As an alternative example $f(x)=x^2$ and $g(x)=x^3$