# A question about composition of functions

Recently, I heard this question: are there two functions $f:\mathbb{R}\to\mathbb{R}$ and $g:\mathbb{R}\to\mathbb{R}$ such that $f\circ g$ is strictly increasing on $\mathbb{R}$ and $g\circ f$ is strictly decreasing on $\mathbb{R}$? I have the feeling that it is not new. Does anybody know any references?

$$f(x)=(-1)^{\lceil x \rceil}\text{abs}(x+\text{sign}(x)),\ g(x)=(-1)^{\lceil x \rceil}\text{abs}(x)$$
• Very nice example. Notice that $g(x)-\mbox{sign}(x)$ is the socalled "windmill function" which is a solution of the functional equation f(f(x))=-x. (see "f(f(x)) = − x, Windmills, and Beyond", Martin Griffiths, Mathematics Magazine,Vol. 83, No. 1 (February 2010), pp. 15-23 ). – Robert Z Jun 25 '16 at 6:30