TITLE: How to prove that there exist no functions $f,g:\Bbb{R}\to\Bbb{R}$ such that $f(g(x))=x^{2018}$ and $g(f(x))=x^{2019}$?
QUESTION [14 upvotes]: I have tried a little bit to solve the problem which goes as follows: 
My intuition says that there exist no $f:\Bbb R\to\Bbb R$ such that $$f(g(x))=x^{2018}\text{ and }g(f(x))=x^{2019}.$$
Note that $$f(g(f(x)))=f(x)^{2018}\implies f(x^{2019})=f(x)^{2018}$$
Similarly, $$g(x^{2018})=g(x)^{2019}$$
Putting $x=1$ in $f(x^{2019})=f(x)^{2018}$, we get $f(1)=f(1)^{2018}$ and thus $f(1)=0$ or $f(1)=1$.
Similarly, putting $x=1$ in $g(x^{2018})=g(x)^{2019}$ we get $g(1)=g(1)^{2019}$ and thus $g(1)=0,1,-1$.
Now, I can't proceed further. Can anybody solve it? Thanks for assistance in advance.

REPLY [19 votes]: Here is a simple proof (to avoid confusion I will write $f^{y}(x)$ instead of $f(x)^{y}$):
Suppose that there are two such functions $f,g$ as in your question.

Note that $\forall\space i \in\{-1, 0, 1\}$, we have $f(i^{2019}) = f(i) = f^{2018}(i)$ and thus $\label{*}\tag{*} f(i) \in \{0, 1\} \quad\forall\space i \in\{-1, 0, 1\}.$ 

On the other hand, since $g(f(x)) = x^{2019} \space\forall x\in\mathbb{R}$,


$g(f(1)) = 1$,
$g(f(0)) = 0$,
$g(f(-1)) = -1$.


This is impossible since $f$ (and thus also $g\circ f$) only takes two (or fewer) values on $\{-1, 0, 1\}$ after \eqref{*}. $\Longrightarrow\Longleftarrow\quad\square$