# (Non-continuous) solutions to $f(f(x))=kx$ and $f(x^2)=xf(x)$

Given a fixed non-zero constant $k\in\mathbb{R}$, find all functions $f:\mathbb{R}\to\mathbb{R}$ satisfying $$f(f(x))=kx\quad\text{and}\quad f\left(x^2\right)=xf(x).$$

If $f$ is continuous, then we can show that the solutions to the second equation are of the form $f(x)=mx$ (see here for example). With the first equation, this immediately implies that $f(x)=\sqrt{k}x$ or $f(x)=-\sqrt{k}x$. However, I am struggling to extend this to non-continuous $f$. Any help would be appreciated.

• It is not likely true for non-continuous $x$. – Thomas Andrews Jan 24 '16 at 13:35
• Hint: the function can jump between two values and still satisfy f(f(x))=kx for example. Note that this is just a hint, not a solution. You need to carefully choose which subsets have which value. – barrycarter Jan 24 '16 at 15:20
• @barrycarter do you have a complete solution? I'm struggling to use your idea – jlammy Jan 24 '16 at 21:16
• More of a hint: f(x) = x*Sqrt[k] for x in set S, and f(x) = x*-Sqrt[k] for x outside of S. Just choose S carefully. – barrycarter Jan 24 '16 at 22:04

Let's suppose for a non-zero constant $k$ and every real number $x$, we have: $$f(f(x))=kx\tag0$$ $$f(x^2)=xf(x)\tag1$$ By $(0)$ you can find out that $f$ is injective. Now, by $(0)$ and $(1)$ you have: $$f\left(f(x)^2\right)=f(x)f(f(x))=kxf(x)=kf\left(x^2\right)=f\left(f\left(f\left(x^2\right)\right)\right)=f\left(kx^2\right)$$ $$\therefore\quad f(x)^2=kx^2\tag2$$ Therefore by $(2)$ we have $k=f(1)^2$ and hence $k$ is positive. Again by $(2)$, for every real number $x$ we get $f(x)=\pm\sqrt kx$.
Now let's define $K^\pm:=\{x\ne0\vert f(x)=\pm\sqrt kx\}$. So we get $\mathbb R=\{0\}\cup K^+\cup K^-$. By $(1)$ we have $f(0)=0$. You can reformulate $(0)$ and $(1)$ this way: $$x\in K^\pm\quad\text{iff}\quad\sqrt kx\in K^\pm\tag3$$ $$x\in K^\pm\quad\text{iff}\quad x^2\in K^\pm\tag4$$ It's easy to see that every function satisfying $f(0)=0$ and $f(x)=\pm\sqrt kx$ for $x\in K^\pm$ is a solution, where $K^\pm$ satisfy the above conditions.
The trivial cases happen when one of $K^\pm$ is empty, and give us the linear solutions $f(x)=\sqrt kx$ and $f(x)=-\sqrt kx$. For a nontrivial case, you can take $K^+=\{\pm k^q\vert q\in\mathbb Q\}$ and $K^-=\{\pm k^q\vert q\in\mathbb R\backslash\mathbb Q\}$.
• As immediate conclusion from $(2)$ it seems we get $f(x)=\pm\sqrt k x$ only for $x\ge 0$. However, $f(-x)=-\frac1x\cdot(-x)f(-x)=-\frac1xf(x^2)=-\frac1x\cdot xf(x)=-f(x)$. – Hagen von Eitzen Jan 25 '16 at 21:26
• For $k=1$ we can let $K^+=\{\pm (2^{2^n} ) :n\in Z\}$. – DanielWainfleet Jan 25 '16 at 23:17
• @HagenvonEitzen Why not concluding $f(x)=\pm\sqrt kx$ for $x<0$ immediately from $(2)$? I see no assumption forcing us to do it for $x\ge0$. – Mohsen Shahriari Jan 26 '16 at 2:45