# Are there two functions $f, g$ such that $f(g(x)) = x^3$ and $g(f(x)) = x^5$?

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}$$?

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 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 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 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.

• 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: Commented Jan 7, 2019 at 18:32
• \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 Commented Jan 7, 2019 at 18:32
• 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$ Commented Jan 8, 2019 at 10:02
• @MaximilianJanisch Oh, yes you're right. I appreciate your comment! And I hope it somehow helped you :) Commented Jan 8, 2019 at 10:25
• 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😃 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.

• 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$). Commented Jan 7, 2019 at 16:51
• 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. Commented Jan 7, 2019 at 17:30
• 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. Commented Jan 7, 2019 at 17:36