I find that roots of

$$f(x)=f^{-1}(x), f:Rrightarrow R~~~~~~~(1)$$

are the same as those of $f(x)=x$ and $f^{-1}(x)=x$ if $f(x)$

an increasing function. If $f(x)$ is decreasing then roots of (1) are the same as

$f(x)=-x$ and $f^{-1}(x)=-x.$ Two functions: $f(x)= x^3$ and $f(x)=-x^3$ are examples.

I would like to know if it is necessarily true, are there exceptions? What could be a generalization of roots of (1) in the light of these two cases.