After watching this Michael Penn video, in which Penn found all $f$ such that $f(f(x))+xf(x)=1$, I was inspired to try my hand at solving a similar problem:
For $x ∈ ℝ _{≥ 0}$, find all functions $f$ that are continuous in their domain such that $$f(f(x)) - xf(x)=0$$ There is obviously the trivial $f(x)=0$, and if we suppose $f(x)=x^c$ then by the equation above we have that $$f(x^c)-x^{c+1}=0 ⇒ f(x^c)=x^{c+1}$$ By the assumption that $f(x)=x^c$, we have that $ f(x^c)=(x^c)^c=x^{c^2}$, and equating these two yields $$x^{c+1}=x^{c²} ⇒ c+1=c² ⇒ c=\phi ⇒ f(x)=x^\phi$$ where $\phi$ is the golden ratio. (The conjugate of $\phi$ works on $ ℝ _{> 0}$).
I think that these two functions ($f(x)=0$ and $f(x)=x^{\phi}$) are the only solutions, but I am struggling to prove it. I have taken / am taking introductory-level proofs classes, so I may not have the tools (or may not realize that I do have the tools) to prove this myself yet. Any tips?
Edit: specified that I am looking for functions that are continuous in their domain, ie not trying to find piecewise functions that work.