Finding all functions $f:\mathbb R\to\mathbb R$ which satisfy $f(xy)=yf(x)+x+f\bigl(f(y)-f(x)\bigr)$

functional-equationsfunctions

-Closed: It has a solution in AOPS.

Find all functions $f:\mathbb R\to\mathbb R$ which satisfy $$f(xy)=yf(x)+x+f\bigl(f(y)-f(x)\bigr)$$
for all $x,y\in\mathbb R$.

My attempt:
\begin{align}
&P(x, x): f\left(x^2\right)=xf(x)+x+f(0). \\
&x=1; \ f(0)=-1. \\
\\
&P(x, 0): -1=x+f\bigl(-1-f(x)\bigr). \implies f\bigl(-f(x)-1\bigr)=-x-1. \\
&x=-1; f\bigl(-f(-1)-1\bigr)=0. \implies \exists t \ \text{ s.t. } f(t)=0. \\
\\
&P(t, 0): -1=t+f(-1). \\
&P(0, t): -1=-t+f(-1). \\
&\therefore 2t=f(1)-f(-1).
\ \\
&P(-1, 1): f(-1)=-f(1)+1+f(-2t). \\
&f(-1)+f(1)-2+f(2t)-f(-2t)=0.
\end{align}

Best Answer

It's straightforward to verify that both $ f = x \mapsto x - 1 $ and $ f = x \mapsto - x - 1 $ satisfy $$ f ( x y ) = y f ( x ) + x + f \bigl ( f ( y ) - f ( x ) \bigr ) \tag 0 \label 0 $$ for all $ x , y \in \mathbb R $. We prove that those are the only $ f : \mathbb R \to \mathbb R $ with this property.

Putting $ x = y = 1 $ in \eqref{0} we get $ f ( 0 ) = - 1 $. Hence, setting $ y = 0 $ in \eqref{0} we have $$ f \bigl ( - 1 - f ( x ) \bigr ) = - x - 1 \tag 1 \label 1 $$ for all $ x \in \mathbb R $, while setting $ x = 0 $ in \eqref{0} we have $$f \bigl ( f ( y ) + 1 \bigr ) = y - 1 \tag 2 \label 2 $$ for all $ y \in \mathbb R $. Letting $ y = - 1 - f ( x ) $ in \eqref{2} and using \eqref{1} we get $$ f ( - x ) + f ( x ) = - 2 \tag 3 \label 3 $$ for all $ x \in \mathbb R $. Interchanging $ x $ and $ y $ in \eqref{0}, we have $$ f ( y x ) = x f ( y ) + y + f \bigl ( f ( x ) - f ( y ) \bigr ) \tag 4 \label 4 $$ for all $ x , y \in \mathbb R $. Adding \eqref{4} to \eqref{0} and using \eqref{3}, we can see that $$ 2 f ( x y ) = x f ( y ) + y f ( x ) + x + y - 2 $$ for all $ x , y \in \mathbb R $, which when $ y = 1 $ gives $$ f ( x ) = a x - 1 $$ for all $ x \in \mathbb R $, where $ a = f ( 1 ) + 1 $. Therefore $$ f \bigl ( f ( 1 ) + 1 \bigr ) = f ( a ) = a ^ 2 - 1 \text , $$ which by setting $ y = 1 $ in \eqref{2} shows that we must have $ a \in \{ - 1 , 1 \} $, and we're done.