Question. Are there two functions $f, g: \mathbb{R}\rightarrow\mathbb{R}$ that satisfy $f(g(x)) = x^3 \enspace\forall x\in\mathbb{R}$ and $g(f(x)) = x^5\enspace\forall x\in\mathbb{R}$?

This is an extension to this question, where I proved that there are no two functions such that $f(g(x)) = x^{2018}$ and $g(f(x))=x^{2019}$ (my proof can easily be extended to any two powers where one power is odd and the other power is even, instead of just $2018$ and $2019$.)

Remark $1$. If there are two such functions, then they satisfy the following properties:

  • $f, g$ are bijective;
  • $f(x^5) = f(x)^3\enspace\forall x\in\mathbb{R}$;
  • $g(x^3) = g(x)^5\enspace\forall x\in\mathbb{R}$;
  • $f(i), g(i)\in\{-1, 0, 1\}\enspace\forall i\in\{-1, 0, 1\}$;
  • $x^9 = f(g(x))^3 = f(g(x^3)) \enspace\forall x\in\mathbb{R}$;
  • $g^{-1}(x)=\sqrt[3]{f(x)}, f^{-1}(x)=\sqrt[5]{g(x)}\enspace\forall x\in\mathbb{R}$.

Remark $2$. A similar question would be if there are two functions such that $f(g(x)) = x^2 \enspace\forall x\in\mathbb{R}$ and $g(f(x)) = x^4 \enspace\forall x\in\mathbb{R}$, or more generally:

For what $i, j\in\mathbb{N}$ are there functions $f,g:\mathbb{R}\rightarrow\mathbb{R}$ such that $f(g(x)) = x^i, g(f(x)) = x^j\enspace\forall x\in\mathbb{R}$?


2 Answers 2


Yes, there exist such $f,g$. Let us define$$ g(x)=\begin{cases}0,\quad x=0\\ 1,\quad x=1\\ \exp\left[5\exp\left(\frac{\log 5}{\log 3}\log \log x\right)\right],\quad x>1\\ \exp\left[-5\exp\left(\frac{\log 5}{\log 3}\log \log \frac{1}{x}\right)\right],\quad 0<x<1\\ -g(-x),\quad x<0 \end{cases} $$ and $$ f(x)=\begin{cases}0,\quad x=0\\ 1,\quad x=1\\ \exp\left[\exp\left(\frac{\log 3}{\log 5}\log \log x\right)\right],\quad x>1\\ \exp\left[-\exp\left(\frac{\log 3}{\log 5}\log \log \frac{1}{x}\right)\right],\quad 0<x<1\\ -f(-x),\quad x<0 \end{cases}. $$ Then we can check that $f,g$ are continuous, odd, strictly increasing bijection on $\mathbb{R}$. And we can also see that $g((0,1))=(0,1)$ and $g((1,\infty))=(1,\infty)$, and the same holds for $f$. Finally, observe that $$ f(g(x))= \begin{cases}\exp\left[\exp\left(\frac{\log 3}{\log 5}\left(\frac{\log 5}{\log 3}\log \log x+\log 5\right)\right)\right]=\exp[3\log x]=x^3,\quad x>1\\\exp\left[-\exp\left(\frac{\log 3}{\log 5}\left(\frac{\log 5}{\log 3}\log \log \frac{1}{x}+\log 5\right)\right)\right]=\exp[-3\log \frac{1}{x}]=x^3,\quad 0<x<1\\ 1,\quad x=1\\ 0,\quad x=0. \end{cases} $$ Since $f,g$ are odd, this shows $f(g(x))=x^3$. Similarly, it holds that $g(f(x))=x^5$.

Note: I guess similar construction works for general odd pairs $(i,j)$ where $i \neq 1,j \neq 1$ by modifying parameters. When $(i,j)$ is an even pair, I guess we can construct even $f,g$ also by modifying paramters.

  • $\begingroup$ I can't believe that this crazy construction works! Absolutely amazing! For general $i,j\in\mathbb{N}$ that are either both odd or both even, I do think the same construction can be used: $\endgroup$ Commented Jan 7, 2019 at 18:32
  • $\begingroup$ \begin{gather} \text{For example for } x>1:\\f(g(x)) = \exp\left[\exp\left[\frac{\ln(i)}{\ln(j)}\cdot\log\left(\log\left(\exp\left[j\cdot\exp(j\cdot\exp(\frac{\ln(j)}{\ln(i)}\cdot\ln(\ln(x))\right]\right)\right)\right]\right]\\ = \exp\left[\exp\left[\frac{\ln(i)}{\ln(j)}\cdot\left(\ln(j)+\frac{\ln(j)}{\ln(i)}\ln(\ln(x))\right)\right]\right]\\ =\exp\left[\exp\left[\ln(i)+\ln(\ln(x))\right]\right]\\ = \mathrm{e}^{i\cdot\ln(x)} = x^i \end{gather} I think the monotonicity and $f,g$-invariance of $]0,1[\text{, } ]1,\infty[$ does still hold $\endgroup$ Commented Jan 7, 2019 at 18:32
  • $\begingroup$ Another small remark: This doesn't (and can't) work for if $\{1\}\subsetneq\{i, j\}$ (i.e. $i=1, j\neq 1$ or vice-versa), since then $g(x^i)=g(x)\overset{!}{=}g(x)^j\>\forall x\in\mathbb{R}$ which is non-sense for $j\neq 1$ $\endgroup$ Commented Jan 8, 2019 at 10:02
  • $\begingroup$ @MaximilianJanisch Oh, yes you're right. I appreciate your comment! And I hope it somehow helped you :) $\endgroup$ Commented Jan 8, 2019 at 10:25
  • $\begingroup$ It did help me, I was getting confused about my inability to prove the non-existence of two such functions. Now I know why I didn't succeed😃 $\endgroup$ Commented Jan 8, 2019 at 11:17

Let $\varphi(x)=x^3$ and $\psi(x)=x^5$. They are bijections from $\mathbb{R}$ to itself. There exists some sets $I$, $J$ that are the reunion of $\{0,\pm 1\}$ and four semi-open intervals such that: For every $x \neq 0,\pm 1$, there exists a unique integer $N \in \mathbb{Z}$ such that $\varphi^N(x) \in I$ (same for $\psi$ and $J$).

Now there is some bijection $T_1 : I \rightarrow J$ of which $0,\pm 1$ are fixed points.

We define the bijection $T$ from $\mathbb{R}$ to itself by $T(\varphi^N(x))=\psi^N(T_1(x))$ if $x \in I$ and $N$ is an integer.

It is easily seen that $T \circ \varphi=\psi \circ T$, ie $T^{-1} \circ (T \circ \varphi)= \varphi$, and $ (T \circ \varphi) \circ T^{-1} = \psi$.

I think this can be generalized to the case $i$ and $j$ odd.

  • $\begingroup$ If you want a precise definition of, say, $I$: $I=\{0,\pm 1\} \cup (-8,-2] \cup [-1/2,-1/8) \cup (1/8,1/2] \cup [2,8)$. (Because $8=2^3$). $\endgroup$
    – Aphelli
    Commented Jan 7, 2019 at 16:51
  • $\begingroup$ I realized that this method is quite general: all that matters is that $\varphi$ and $\psi$ are continuous increasing bijections with the same fixed points. The functions $f$ and $g$ will then have the same fixed points and they should be continuous and increasing. $\endgroup$
    – Aphelli
    Commented Jan 7, 2019 at 17:30
  • $\begingroup$ The above comment is incorrect; the last sentence should be: The functions $f$ and $g$ will then have the same fixed points and they will be continuous and increasing provided $T_1$ is defined properly and the fixed points of $f$ and $g$ are similarly attractive or repulsive. $\endgroup$
    – Aphelli
    Commented Jan 7, 2019 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .