Find all functions on the non-zero reals to itself satisfying $f(xy)=f(x+y)(f(x)+f(y))$

Find all functions $f\colon\mathbb{R}\setminus\{0\}\to\mathbb{R}\setminus\{0\}$ such that $f(xy)=f(x+y)(f(x)+f(y))$.

I'm reasonably confident that the solutions are $f(x)=\frac{1}{x}$ and $f(x)=\frac{1}{2}$. Here's some progress:

Let $P(x,y)$ be the assertion $f(x+y)(f(x)+f(y))=f(xy)$, and let $a=f(1)$.

$P(1,1)\implies f(2)=\frac{1}{2}$.

$P(2,1)\implies f(3)=\frac{1}{2a+1}$.

$P(3,1)\implies f(4)=\frac{1}{2a^2+a+1}$.

$P(4,1)\implies f(5)=\frac{1}{2a^3+a^2+a+1}$.

$P(5,1)\implies f(6)=\frac{1}{2a^4+a^3+a^2+a+1}$.

$P(2,3)\implies (2a-1)(a-1)(a+1)(2a^2+a+1)=0$ and so $\boxed{a\in\left\{-1,\frac{1}{2},+1\right\}}$.

If $a=1$, then inductively $f(n)=\frac{1}{n}$ $\forall n\in\mathbb{N}$. Let $x>0$. Then if $n\in\mathbb{N}$, considering $P(x+n,1)$ inductively, we get $f(x+n)=\frac{f(x)}{nf(x)+1}<\frac{1}{n}$, and so $P(x,n)\implies f(nx)=\frac{f(x)}{n}$. Thus $f(x)\leq\frac{1}{n}$ if $x\geq n$, so for $x\geq1$, we have $f(x)\leq\frac{1}{\lfloor x\rfloor}$. Then for $x>1$, inductively we have $$f(x)^{2^n}=f\left(x^{2^n}\right)\leq\frac{1}{\left\lfloor x^{2^n}\right\rfloor},$$ so taking the $2^n$th root and $n\to\infty$, we get $f(x)\leq\frac{1}{x}$ for all $x\geq1$ (Could someone verify that this part is rigorous?). But since $f(2^nx)=\frac{f(x)}{2^n}$, we get $f(x)\leq\frac{1}{x}$ for all $x\geq\frac{1}{2^n}$. Again, taking $n\to\infty$, $f(x)\leq\frac{1}{x}$ for all $x>0$.

Now $P\left(x,\tfrac{1}{x}\right)\implies1=f(1)=f(x+1/x)(f(x)+f(1/x))\leq1$, so $f(x)=\frac{1}{x}$ $\forall x>0$.

However, I'm struggling first to extend this to $x<0$, and secondly to deal with the cases $a=\frac{1}{2}$, $a=-1$.

EDIT:

I've solved the problem. If $x<0$, then $f(x)^2=f\left(x^2\right)\implies f(x)=\pm\frac{1}{x}$. Choosing $n>|x|$, we have $$\frac{1}{x+n}=f(x+n)=\frac{f(x)}{nf(x)+1},$$and it is clear then that $f(x)=\frac{1}{x}$ $\forall x\in\mathbb R\setminus\{0\}$, which is indeed a solution.

If $f(1)=\frac{1}{2}$, then we claim that $\boxed{f(x)=\frac{1}{2}\;\forall x\in\mathbb{R}\setminus\{0\}}$ is the unique solution.

Inductively, $f(n)=\frac{1}{2}$ $\forall n\in\mathbb N$.

$P(x,1)\implies f(x+1)=\frac{2f(x)}{2f(x)+1}$, and thus $f(x+2)=\frac{4f(x)}{6f(x)+1}$ and $f(x+4)=\frac{16f(x)}{30f(x)+1}$.

$P(x,2)\implies f(2x)=\frac{2f(x)(2f(x)+1)}{6f(x)+1}$.

$P(2x,2)\implies f(4x)=\frac{4f(x)(2f(x)+1)(8f(x)^2+10f(x)+1)}{(6f(x)+1)(24f(x)^2+18f(x)+1)}$.

$P(x,4)\implies f(4x)=\frac{8f(x)(2f(x)+1)}{30f(x)+1}$.

Equating the two expressions for $f(4x)$, we get $(2f(x)-1)^2(2f(x)+1)(12f(x)+1)=0$. Thus $f(x)=\frac{1}{2}$ $\forall x\in\mathbb R\setminus\{0\}$.

If $f(1)=-1$, then we claim that there are no solutions.

$P(x,1)\implies f(x+1)=\frac{f(x)}{f(x)-1}$, so $P(x+1,1)\implies f(x+2)=f(x)$. Thus $f(4)=f(2)=\frac{1}{2}$. But \begin{align*}P(x,2)&\implies f(2x)=f(x+2)\left(f(x)+\tfrac{1}{2}\right)=f(x)\left(f(x)+\tfrac{1}{2}\right)\\ P(x,4)&\implies f(4x)=f(x+4)\left(f(x)+\tfrac{1}{2}\right)=f(x)\left(f(x)+\tfrac{1}{2}\right)\end{align*}Thus $f(x)=f(2x)=f(x)\left(f(x)+\tfrac{1}{2}\right)\implies f(x)=\frac{1}{2}$ $\forall x\in\mathbb R\setminus\{0\}$, a contradiction.


Solution 1:

[To get this question out of the unanswered state, here's a slight reformulation of the self-answer the OP added to their question]

Note that if we have $f(x)=-f(y)$ for some $x,y\ne 0$, then $P(x,y)$ gives us $f(xy)=0$, which is absurd. We conclude that in such cases $x+y=0$, i.e., $$\tag1f(x)=-f(y)\implies x=-y.$$

From $P(2,2)$, we get $f(4)=2f(4)f(2)$ and hence $$ f(2)=\frac12.$$ By this and eliminating $f(-2)$ from $P(2,-1)$, $$f(-2)=f(1)(f(2)+f(-1))$$ and $P(-1,-1)$,$$f(1)=f(-2)(f(-1)+f(-1)),$$ we get $$\tag2 f(-1)\in\{-1,\tfrac 12\}.$$ As in the OP, we use $P(2,3)$ and others to conclude that $$ f(1)\in\{-1,\tfrac12,1\}.$$ Let $$g(x)=\begin{cases}\frac1{f(x)}&x\ne 0\\0&x=0\end{cases}.$$

Then $P(x,y)$ can be rewritten as $$\tag{$Q(x,y)$} g(x)g(y)g(x+y)=g(xy)(g(x)+g(y))\qquad \text{if }x+y\ne 0$$ (a priori, we also have to postulate $x\ne 0$ and $y\ne 0$, but for these, $Q(x,y)$ is trivially true).


Suppose $f(1)=1$.

Lemma 1. For all $x\in\Bbb R$, we have $g(x+1)=g(x)+1$.

Proof. For $x\ne 0,-1$, this is just $Q(x,1)$, divided by $g(x)$. For $x=0$, the claim is trivial. If $g(-1)=2$, then from the cases already shown, we find $g(-3)=g(-2)-1=g(-1)-2=0$, which is absurd. Hence from $(2)$, we conclude $f(-1)=-1$, whence the case $x=-1$. $\square$

Corollary 1. For all $x\in\Bbb R$ and $n\in\Bbb Z$, we have $g(x+n)=g(x)+n$. In particular, $g(n)=n$ for $n\in\Bbb Z$.

Proof. From lemma 1 by induction. $\square$

Corollary 2. $g(-x)=-g(x)$.

Proof. For $x=\pm1$, this is clear. For all other cases, divide $Q(x,-1)$ by $g(x-1)=g(x)-1\ne 0$. $\square$

Remark. This allows us to drop the restriction "if $x+y\ne 0$" from $(Q(x,y))$ above.

From $(1)$ then now get the

Corollary 3. $f$ is injective. $\square$

Corollary 4. For all $x\in\Bbb R$, $n\in\Bbb Z$, we have $g(nx)=ng(x)$.

Proof. We obtain from $Q(x,n)$ and corollary 1 $g(x)ng(x+n)=g(nx)(g(x)+n)=g(nx)g(x+n) $. If $x+n\ne 0$, the claim follows by dividing by $g(x+n)\ne 0$; if $x+n=0$ the claim follows directly from corollary 1. $\square$

From $Q(x,x)$, we find $g(x)^2g(2x)=g(x^2)2g(x) $ and so by corollary 4, $$\tag3g(x^2)=g(x)^2\qquad\text{for all }x\in\Bbb R. $$ Together with corollary 2, this means $$ g(x)>0\iff x>0.$$ Combining with corollaries 1 and 4, $$ng(x)+m>0\iff nx+m>0 $$ for all $n,m\in\Bbb Z$, $x\in \Bbb R$. We conclude $$g(x)=x\qquad\text{for all }x\in\Bbb R.$$

Suppose f(1)=\frac12$.

From $Q(x,1)$, $$g(x+1)=\frac12g(x)+1\qquad x\ne 0,-1, $$ hence by iterating, $$g(x+2)=\frac14g(x)+\frac32\qquad x\ne 0,-1,-2, $$ and $$g(x+4)=\frac1{16}g(x)+\frac{15}8\qquad x\ne 0,-1,-2,-3,-4. $$ On the other hand, $Q(x,2)$, $$2g(x) g(x+2)=g(2x)(g(x)+2),\qquad x\ne 0,-2,$$ so $$g(2x)=\frac{g(x)(g(x)+6)}{2g(x)+4},\qquad c\ne 0,-1,-2 $$ and by interating, $$ g(4x)=\frac{g(x)(g(x)+6)(g(x)^2+16g(x)+24)}{4(g(x)+2)(g(x)^2+10g(x)+8)}, \qquad x\ne 0,-\frac12,-1,-2.$$ $Q(x,4)$, $$2g(x)g(x+4)=g(4x)(g(x)+2),\qquad x\ne 0,-4,$$ so $$ g(4x)=\frac{g(x)(g(x)+30)}{8(g(x)+2)},\qquad x\ne 0,-1,-2,-3,-4.$$ Equating the two expressions for $g(4x)$, we end up at $$ (g(x)-2)^2(g(x)+12)(g(x)^2+10g(x)+8)=0,\qquad x\ne0,-\frac12,-1,-2,-3,-4.$$ Thus for all $x>0$ and all $x\ll 0$, we have $g(x)\in\{2,-\frac1{12},-5\pm\sqrt{17}\}$. For these, $g(x+1)\in \{2,\frac 34,-\frac32\pm\frac12\sqrt{17}\}$. There is only one intersection so that $g(x)=2$ for all $x>0$ and all $x\ll 0$. Using the $g(x+1)$ formula, we finally get $$f(x)=\frac12\qquad\text{for all}x\ne 0.$$

Suppose f(1)=-1$

This time, $$ g(x+1)=1-g(x),\qquad x\ne 0,-1,$$ hence $$\tag4g(x+2)=g(x),\qquad x\ne 0,-1,-2.$$ From $Q(x,2)$ and $(4)$, $$ 2g(x)^2=g(2x)(g(x)+2),\qquad x\ne 0,-1,-2,$$ and from $Q(x,4)$ and $(4)$, $$2g(x)^2=g(4x)(g(x)+2),\qquad x\ne 0,-1,-2,-3,-4.$$ We conclude $g(2x)=g(4x)$ for almost all $x$, including $x=\frac12$. But that means $-1=g(1)=g(2)=2$, contradiction.