# Prove that there exists $f,g : \mathbb{R}$ to $\mathbb{R}$ such that $f(g(x))$ is strictly increasing and $g(f(x))$ is strictly decreasing.

Prove that there exists $f,g : \mathbb{R}$ to $\mathbb{R}$ such that $f(g(x))$ is strictly increasing and $g(f(x))$ is strictly decreasing.

I tried cases by taking $f(x)$ as an increasing function and $g(x)$ as a decreasing function then I am getting both $f(g(x))$ and $g(f(x))$ as decreasing functions. Further I took both of them as increasing functions, but none of them are yielding results. Help

• If $f$ and $g$ are differentiable, you can't pick them to be monotone, because $f'(g(x))g'(x)$ and $g'(f(x))g'(x)$ must have opposite signs for all $x$, no? – Ivo Terek Feb 26 '17 at 14:39
• With other words, having read the comments and answers below: any function pair obeying the question's requirements must be pathological? – Han de Bruijn Mar 3 '17 at 15:27
• This was asked in Romanian Master of Mathematics 2011: see here or here. Also, related PPCG post. – Ankoganit May 24 '17 at 5:17

Here is a construction that uses the axiom of choice. I'm not sure if it can be avoided.

Let $p$ be an increasing bijection ${\mathbb R} \to \mathbb R$ such that $p(0)=0$ and $0$ is the only fixed point of any iterate of $p$ (for example, $p(x)=2017x$ will do).

Let also $q$ be a decreasing bijection ${\mathbb R} \to \mathbb R$ such that $q(0)=0$ and $0$ is the only fixed point of any iterate of $q$ (for example, $q(x)=-2017x$ will do).

The iterates of $p$ form a group under composition which we call $P$. Then $P$ acts on ${\mathbb R}^*$. By the axiom of choice, there is a transversal $T_p\subseteq {\mathbb R}^*$ containing exactly one element from each orbit, then the map ${\mathbb Z} \times T_p \to {\mathbb R}^*, (k,x)\mapsto p^k(x)$ is bijective.

Similarly, there is a $T_q\subseteq {\mathbb R}$ such that ${\mathbb Z} \times T_q \to {\mathbb R}^*, (k,x)\mapsto q^k(x)$ is bijective.

By a well-known result in cardinality theory, since $T_q$ and $\mathbb Z$ are both infinite and $|T_q|>|{\mathbb Z}|$, we have $|{\mathbb Z} \times T_q|=|T_q|$. It follows that there is a bijective map $b:T_q \to T_p$.

Now, define $f$ by $f(0)=0$ and for nonzero $r$, say $r=q^{k}(t)$ with $t\in T_q$, put $f(r)=p^{k}(b(t))$. Similary, define $g$ by $g(0)=0$ and for nonzero $r$, say $r=p^{k}(b(t))$ with $t\in T_q$, put $g(r)=q^{k+1}(t)$.

By construction, one then has $f\circ g=p$ and $g\circ f=q$.

• Please explain how iterates of $p$ forms a group?(i.e. whats the inverse?) Also, what is the identity in the group of iterates of $q$? – Akshay Hegde Mar 6 '17 at 2:25
• @Akshay Hedge How "iterates of $p$ form a group" is already explained in the text : under composition. The identity is the identity map of $\mathbb R$, and the inverse is the inverse bijection. – Ewan Delanoy Mar 6 '17 at 8:15

To satisfy strict monotonicity in the composites, both functions must be injective (1-to-1). However to product opposite monotonicity, $f$ and $g$ must be discontinuous everywhere, since even a short stretch of monotone behaviour will produce the same behaviour in both compositions.

Also, although this is less certain, since $f \circ g$ and $g\circ f$ are strictly monotone, they are continuous almost everywhere. So essentially we need to disassemble the real number line into points, and then reassemble it.

This suggests we need to have something like functions that split by eg. rational and irrational numbers in an apparently chaotic fashion. However in the end I think this will be an existence proof rather than a demonstrated example.

• Citing one example of such a function will suffice. Can you give an example of such a function based on your argument? – Legend Killer Feb 26 '17 at 15:15
• @AyanBiswas No, as I say I don't think that it is feasible to directly specify the functions. If one such pair exists, there will be an infinite collection of them, but they will all be chaotic. – Joffan Feb 26 '17 at 15:21
• I don't understand this: "because $f\circ g$ and $g\circ f$ are strictly monotone, they are continuous everywhere." A strictly monotone function can have a countably infinite number of discontinuities. – Jonas Meyer Mar 3 '17 at 3:54
• @JonasMeyer Regarding continuity, I had some concept that I convinced myself of at the time of writing, but that might have been wrong so I reduced that claim. I don't think it affects the general conclusion that $f$ and $g$ are chaotic. – Joffan Mar 3 '17 at 14:36
• @JonasMeyer this is really interesting, I am trying to build a suitable function based on this conversation. – Joffan Mar 3 '17 at 16:57

EDITED

Let the domain and range of both $f$ and $g$ be the real line. Furthermore assume that the derivatives exist. Also, assume that they do not have inflexions with zero derivative. If we do not assume that the whole line is the domain then counterexample(s) can be created. (See Han de Bruijn's comment to this post.)

In order for $f(g(x))$ to be strictly increasing we need that the derivative wrt $x$ be positive

$$f(g(x))'= f'(g(x))g'(x)>0.$$

So, both $f'(g(x)$ and $g'(x)$ have to be positive xor negative. In order for $g(f(x))$ to be strictly decreasing we need that the derivative wrt $x$ be negative. $$g(f(x))'= g'(g(x))f'(x)<0.$$
One of the components has to be negative and the other one has to be positive but not the same sign at the same time.

Above we requested the opposite.

• It's not true that strictly increasing functions must have positive derivative everywhere. Also, the question did not require $f,g$ to be differentiable. – Josh Chen Feb 26 '17 at 14:53
• Ok. Then I delete. – zoli Feb 26 '17 at 14:54
• And this doesn't discard the possibility that we could have $f$ and $g$ differentiable but oscilating furiously so that the signs worked out fine in the end.. – Ivo Terek Feb 26 '17 at 14:55
• Since in (physics) practice any function that is defined at an uninterrupted interval of reals is continuous (and even has derivatives), I have given you an upvote. Please do not delete this answer. – Han de Bruijn Mar 4 '17 at 11:27
• @Han de Bruijn: Thank you. I did not plan to delete this answer even if it was twice down voted. (And it was up voted twice --- controversy.) I left my answer as is because it gives at least a partial answer. I would leave it even if further down votes would come. – zoli Mar 4 '17 at 12:03

First, we say two intervals $A$<$B$, if $\forall a\in A, b\in B$ such that $a$<$b$, like $(-1,2]$<$(2,4]$. If $g\circ f(x)$ is increasing on A and B, then we want the image of A, B satisfying $h[A]$<$h[B]$; $f\circ g(x)$ is decreasing on $A$ and $B$, then we just have to let the image of $A, B$ satisfying $k[B]$<$k[A]$, which ensures the monotonicity (more) globally.

Give an example to show how it really works. Eventually we partition the real plain $\mathbb{R}^2$ into integer lattices. In each square, the function $f$, $g$ looks like either $\frac{1}{2}x+\frac{1}{4}$, or $-\frac{1}{2}x+\frac{3}{4}$. We should, however, shift the boxes so that we achieve what we said before.

On even-number-th interval, $f,g$ look like $-\frac{1}{2}x+\frac{3}{4}$; on odd-number-th interval, $f,g$ look like $\frac{1}{2}x+\frac{1}{4}$ inside its square. We have to map correctly from squares to squares i.e. $\mathbb{Z}\to\mathbb{Z}$ such that the local and global monotonicities are satisfied.

I.e. find two functions $i,d:\mathbb{Z}\to\mathbb{Z}$, $i$ is parity-preserving and $d$ parity-reversing, $d\circ i$ increasing, $i\circ d$ decreasing. E.g. It is not hard to check $$i(n)=\begin{cases}2n & \text{even}\\-2n+1&\text{odd}\end{cases}\quad d(n)=\begin{cases}2n+1 & \text{even}\\-2n&\text{odd}\end{cases}$$ satisfy the requirements. These functions indicate where the squares are vertically.

Finally, put all together, $$f(x)=\begin{cases}-\frac{1}{2}(x-\lfloor x\rfloor)+\frac{3}{4}+i(\lfloor x\rfloor) & \lfloor x\rfloor\text{ is even}\\\frac{1}{2}(x-\lfloor x\rfloor)+\frac{1}{4}+i(\lfloor x\rfloor)&\lfloor x\rfloor\text{ is odd}\end{cases}$$ $$g(x)=\begin{cases}-\frac{1}{2}(x-\lfloor x\rfloor)+\frac{3}{4}+d(\lfloor x\rfloor) & \lfloor x\rfloor\text{ is even}\\\frac{1}{2}(x-\lfloor x\rfloor)+\frac{1}{4}+d(\lfloor x\rfloor)&\lfloor x\rfloor\text{ is odd}\end{cases}$$

With the same idea, a refined solution:

First, let $f(0)=g(0)=0$. Then, we partition the axis into $\{\pm[{2^n},{2^{n+1}})\}_{n\in\mathbb{Z}}$ for $f$ and $\{\pm[{2^n\sqrt{2}},{2^{n+1}\sqrt{2}})\}_{n\in\mathbb{Z}}$ for $g$. Then $f,g$ take value from either $\sqrt{2}x$ or $-\sqrt{2}x$ alternatingly on the partitioned intervals respectively starting to take value $\sqrt{2}x$ on $\pm[1,2)$ and $\pm[\sqrt{2},2\sqrt{2})$.