<s>[INST] Finding all functions $f:\mathbb R\to\mathbb R$ which satisfy $f(xy)=yf(x)+x+f\bigl(f(y)-f(x)\bigr)$ -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}
 [/INST] Solution from AOPS:
\begin{align}
&\text{let } P(x, y): f(xy)=yf(x)+x+f(f(y)-f(x)). \\
\ \\
&P(x, 1): f(f(1)=f(x))=-x. \Rightarrow f: \text{ Bijective.} \\
\ \\
&P(x, 0): f(-f(x)=1)=-x-1. \\
&P(0, x): x-1=f(f(x)+1). \\
&\therefore f(f(x)+1)+f(-f(x)-1)=-2. \\
&\text{Because } f \text{ is surjective, } f(-x)+f(x)=-2. \\
\ \\
&P(-x, -y): \\
&f(xy)=-yf(-x)-x+f(f(-y)-f(-x)) \\
&\ \ \ \ \ \ \ \ \ \ =-y(-2-f(x))-x+f((-2-f(y))-(-2-f(x))) \\
&\ \ \ \ \ \ \ \ \ \ =-y+yf(x)-x+f(f(x)-f(y)) \\
&\ \ \ \ \ \ \ \ \ \ =2y+yf(x)-x-f(f(y)-f(x))-2. \\
\ \\
&\text{Comparing this to the original F.E.: } \\
&yf(x)+x+f(f(y)-f(x))=2y+yf(x)-x-f(f(y)-f(x))-2 \\
& \Rightarrow 2f(f(y)-f(x))=2y-2x-2 \Rightarrow f(f(y)-f(x))=y-x-1. \\
\ \\
&\text{Contributing this to the original F.E.: } \\
&f(xy)=yf(x)+y-1. \\
&x=1; f(y)=yf(1)+y-1. \\
& \Rightarrow f(xy)-f(y)=y(f(x)-f(1)). \\
&x=0; -1-f(y)=-y-yf(1). \\
&\Rightarrow f(y)+1=y(f(1)+1). \\
&\text{let } f(1)+1=c. \\
& \Rightarrow \dfrac {f(y)+1}{y}=c. \\
&\Rightarrow f(y)=cy-1. \\
\ \\
&\text{Contributing this to the original F.E.:} \\
&cxy-1=cxy-y+x+c^2(y-x)-1. \\
&\Rightarrow x-y+c^2(y-x)=0. \\
&\Rightarrow (y-x)(c^2-1)=0. \\
&\text{For }x \neq y: \ c^2=1, \ c=\pm 1. \\
\ \\
&\therefore f(x)=\pm x-1.
\end{align}
</s>