Determine all functions $f:\mathbb{R}\to\mathbb{R}$ which satisfy the following relationship for all real numbers $x$ and $y$\[f(xf(y)-f(x))=2f(x)+xy.\]
Problem
Source:
Tags: algebra, function, Romanian TST, TST
15.05.2021 20:13
oVlad wrote: Determine all functions $f:\mathbb{R}\to\mathbb{R}$ which satisfy the relationship \[f(xf(y)-f(x))=2f(x)+xy,\text{ for any }x,y\in\mathbb{R}.\] Let $P(x,y)$ be the assertion $f(xf(y)-f(x))=2f(x)+xy$ Let $a=f(0)$ $P(1,x)$ $\implies$ $f(f(x)-f(1))=2f(1)+x$ and $f(x)$ is bijective Let $u=f^{-1}(0)$ $P(u,0)$ $\implies$ $f(ua)=0=f(u)$ and so since injective, $ua=u$ And so $u=0$ or $a=1$ If $u=0$ (and so $a=0$ ) : $P(x,0)$ $\implies$ $f(-f(x))=2f(x)$ and so, since surjective, $f(x)=-2x\quad\forall x$ Which unfortunately is not a solution. If $a=1$ : $P(u,u)$ $\implies$ $u^2=1$ and so $u=-1$ (since $u\ne a$) $P(x,-1)$ $\implies$ $f(-f(x))=2f(x)-x$ $P(-1,x)$ $\implies$ $f(-f(x))=-x$ And so $2f(x)-x=-x$ and $f\equiv 0$, which is not a solution. Hence $\boxed{\text{No such function}}$
15.05.2021 20:27
15.05.2021 20:28
pco wrote: ...and so $u=-1$ (since $u\ne a$) Why $u \ne a$? In fact, I think that $u=a=1$ leads to the solution $f(x)=1-x$.
15.05.2021 20:49
You're right! I decided $u\ne a$ wrongly using (badly) injectivity
16.05.2021 10:40
I guess this is the outcome when I try and do FE's past midnight, here is an unnecessarily lengthy solution which is motivated by $P(x,2)$ after some "initial work".
16.05.2021 13:15
Cute Let $P(x,y)$ be the assertion. Firstly, we do the following observations: $P\left(x,-\frac{2f(x)}{x}\right)\implies f(xf\left(-\frac{2f(x)}{x}\right)-f(x))=0$. $f$ is injective from $P(1,a_1)$ and $P(1,a_2)$ if $f(a_1)=f(a_2)$. Hence, $\exists a$ so that $f(a)=0$. $P\left(x,-\frac{f(x)}{x}\right)\implies xf\left(-\frac{f(x)}{x}\right)-f(x)=x$. If $a\neq 0$, then we get plugging $x=a$ into the equation above, we obtain $f(0)=1$. Here from $P(1,1)$ we obtain $1=2f(1)+1\implies f(1)=0$ (and thus $a$ is actually $1$ from injectivity). Now we break our proof into two cases: Case 1. $f(1)=0$ and $f(0)=1$. $P(0,y)\implies f(-1)=2$. $P(1,y)\implies f(f(y))=y$ and therefore $f(2)=f(f(-1))=-1$. $P(x,2)\implies f(-x-f(x))=2(x+f(x))$. On the other hand, $P(f(x+f(x)),1)\implies f(-x-f(x))=2(x+f(x))+f(x+f(x))$, therefore $f(x+f(x))=0=f(1)$ and from the injectivity, we get solution $f(x)=1-x\forall x\in\mathbb R$. Case 2. $f(0)=0$. Here we bring out a weird contradiction argument to nuke this case. $P(x,0)\implies f(-f(x))=2f(x)$. Taking $x\rightarrow -f(x)$, we have $f(-2f(x))=4f(x)$. From $P\left(x,-\frac{2f(x)}{x}\right)$ by injectivity, $f\left(-\frac{2f(x)}{x}\right)=\frac{f(x)}{x}$. Taking here $x\rightarrow -f(x)$, we obtain $f(4)=-2$. Notice that from $f(-2f(x))=4f(x)$, taking $x=4$, we have $-2=f(4)=-8$, contradiction, get nuked. We conclude that our only solution is $\boxed{f(x)=1-x\forall x\in\mathbb R}$. This obviously satisfies the given.
16.05.2021 15:30
$P(1,x)\Rightarrow f(f(x)-f(1))=2f(1)+x\Rightarrow f$ is bijective. Let $k=f^{-1}(0)$. $P(k,x)\Rightarrow f(kf(x))=kx$ $P(k,kf(x))\Rightarrow f(k^2x)=k^2f(x)$ Now we can say that $0\in\{f(0),f(-1),f(1)\}$. There are many ways to prove this ($x=1/k,0,k$), but we will take $x=k$, so $f(k^3)=k^2f(k)=0=f(k)$, hence $k\in\{0,-1,1\}$. $\textbf{Case 1: }f(0)=0$ $P(x,0)\Rightarrow f(-f(x))=2f(x)$, by surjectivity now we have $f(x)=-2x$, which doesn't work. $\textbf{Case 2: }f(1)=0$ $P(1,1)\Rightarrow f(0)=1$ $P(0,20)\Rightarrow f(-1)=2\Rightarrow f(2)=f(f(-1))=-1$ $P(1,x)\Rightarrow f(f(x))=x$ $P(f(x),1)\Rightarrow f(-x)=2x+f(x)$ $P(x,2)\Rightarrow f(-x-f(x))=2f(x)+2x f(x+f(x))=0\Rightarrow\boxed{f(x)=1-x}$, which works (using $P(f(x),1)$). $\textbf{Case 3: }f(-1)=0$ $P(-1,x)-P(x,-1)\Rightarrow 2f(x)-x=-x\Rightarrow f(x)=0$, which doesn't work.
16.05.2021 18:06
My sol: (a bit over–complicated lol) Observe that if $f(a)=f(b)$ then $P(1,a)$ and $P(1,b)$ directly give us $a=b$, so $f$ is injective. Moreover, $P(1,c-2f(1))$ gives us $f(f(c-2f(1))-f(1))=c$ so $f$ is surjective too. Therefore, $f$ is bijective. Now, let $c\in\mathbb{R}$ such that $f(c)=0$. $P(c,c)$ gives us $f(0)=c^2$ and, using this, $P(c,0)$ gives us $f(c^3)=0$. Because $f$ is bijective, we can conclude that $c^3=c$ so $c\in\{0,1,-1\}$. Assume $c=0$. Using the fact that $f$ is bijective, $P(f^{-1}(-x),0)$ gives us $f(x)=-2x$. Therefore, for any $x$ we have $f(x)=-2x$, but a simple check will reveal the fact that this does not work. Assume $c=-1$. Then $P(-1,x)$ gives us $f(-f(x))=-x$ and $P(x,-1)$ gives us $f(-f(x))=2f(x)-x$ and combining these two equations, $f(x)=0$ for any $x$. However, this is also a contradiction. Therefore, $c=1$. So $f(1)=0$ and using the fact that $f(0)=c^2$ we get $f(0)=1$. Moreover, $P(0,0)$ gives us $f(-1)=2$ and $P(1,x)$ results in $f(f(x))=x$. Therefore, $-1=f(f(-1))=f(2)$. Therefore, $P(x,2)$ gives us $f(-(f(x)+x))=2(f(x)+x)$. Let $f(x)+x=k$, so for this $k, \ f(-k)=2k$. Now, observe that $P(x,0)$ gives us $f(x-f(x))=2f(x)$. Combining $f(x-f(x))=2f(x)$ with the fact that $f$ is bijective, we get that $g:\mathbb{R}\to\mathbb{R}, \ g(x)=x-f(x)$ is surjective. Now, let $x=\alpha$ such that $g(\alpha)=-k$. Therefore, $f(\alpha-f(\alpha))=2f(\alpha)\iff f(-k)=2f(\alpha)\iff 2k=2f(\alpha)$. So $f(\alpha)=k$ but we chose $\alpha$ such that $g(\alpha)=-k\iff \alpha-f(\alpha)=-k\iff\alpha-k=-k$ so $\alpha=0$. Therefore, $0-f(0)=-k$ so $k=1$! But remember that we chose $x+f(x)$ to be $k$. Therefore, for any $x$ we have $x+f(x)=1$ which gives us the desired function, $f(x)=1-x$.
16.05.2021 20:27
For instance $f(x)=x$ is bijective but $x-f(x)$ is not.
16.05.2021 21:04
I know. Let me prove the assertion for you. Assume $g(x)$ is not surjective. Therefore, there exists some $k$ such that $g(x)\neq k$ for any $x$. Therefore, because of the fact that $f$ is bijective, $f(x-f(x))\neq f(k)$ for any $x$. However, just take $x=f^{-1}\bigg(\frac{f(k)}{2}\bigg)$ and observe that plugging this in $f(x-f(x))=2f(x)$ gives us the fact that, indeed, for some $x$ we have $f(x-f(x))=f(k)$, contradiction. Therefore, $g(x)$ is surjective. Indeed, if $f(x)$ is bijective it does not solely imply $g(x)$ is surjective, but we also have the condition that $f(x-f(x))=2f(x)\iff f(g(x))=2f(x)$.
17.05.2021 11:36
\(f\) is bijective. Let \(f(a)=0\) and \(f(b)=1\). \(P(a,b)\) gives \(ab=0\). 1) \(a=0\), \(P(x,0) \implies f(x)= -2x\), not a solution. 2) \(b=0\), \(P(a,a) \implies a=1\) or \(a=-1\). \(i)\) \(a=-1\), \(P(-1,x)\) and \(P(x,-1) \implies f(x)=0\), not a solution. \(ii)\) \(a=1\), \(P(1,x) \implies f(f(x))=x\), \(+P(x,1) \implies f(-f(x))=2f(x)+x\), \(+P(f(x),1) \implies *f(-x)=f(x)+2x \implies f(-1)=2\), \(+P(-1,x) \implies f(-f(x)-2)=4-x\). \(+\)Using * with the last equation gives \(f(f(x)+2)=-x-2f(x)=-f(-f(x))\). From surjectivity we have \(f(-x)+f(x+2) \implies f(x)+f(2-x)=0\). \(+P(x,2-y)\) and using * gives \(f(xf(y)+f(x))+2xf(y)+xy=2x\). Plugging \(y=0\) in the last equation we have \(f(x+f(x))=0 \implies f(x)=1-x\) which is a solution.
19.05.2021 19:29
Let the assertion to the given Functional Equation be $P(x,y)$. Claim 1: $f$ is surjective. $\text{Proof:}$ $P(1,y)$ gives $$f(f(y)-f(1))=2f(1)+y$$and as $y$ is surjective in $\mathbb{R} \to \mathbb{R}$, so $f$ must be surjective.$\square$ Now, as $f$ is surjective, so $\exists \,\, \alpha : f(\alpha)=0$ Claim 2: $f(0)=\alpha^2$. $\text{Proof:}$ $P(\alpha , \alpha)$ gives $$f(0)=\alpha ^2 $$This proves our claim. $\square$ Claim 3: $f$ is injective. $\text{Proof:} $ $P(\alpha,y)$ gives $$f(\alpha f(y))=\alpha y$$This is immediately shows injectivity. $\square$
Claim 4: Only possible values of $\alpha$ are $1,0,-1$. $\text{Proof:}$ $P(\alpha,0)$ gives $$f(\alpha f(0))=0$$By Claim 2 and Claim 3, we have: \[f(\alpha^3)=f(\alpha)=0\]By bijectivity, we get $\alpha^3=\alpha \implies \alpha \in \{1,-1,0\}$. $\square$ Claim 5: $\alpha$ can neither be $-1$ nor $0$. $\text{Proof:}$ We will split it into two cases: Case 1: $f(-1)=0$ is impossible. $\text{Proof:}$ Trying $P(0,y)$ gives $$f(-f(0))=2f(0)$$but by Claim 2 putting $f(0)=\alpha^2=1$ we get: \[0=f(-1)=2 \times 1=2\]which is absurd. $\square$ Case 2: $f(0)=0$ is impossible. $\text{Proof:}$ Trying $P(x,0)$ we get: \[f(-f(x))=2f(x)\]Using surjectivity, set $f(x)=z$ for all real $z$. We get $f(z)=-2z$ which does satisfy the original equation.$\square$ $\textcolor{red}{\textbf{\textsf{Claim 6:}}}$ If $f(1)=0$ then, $f(x)=1-x$ is the only solution.
We will firstly show some lemmas: Lemma 1: $f(f(x))=x$ if $f(1)=0$ $\text{Proof:}$ $P(x,1)$ gives it immediately with $f(1)=0$ or put $\alpha=1$ in Claim 3. $\square$ Lemma 2: $f(-x-f(x))=2(x+f(x))$ if $f(1)=0$. $\text{Proof:}$ $P(x,2)$ gives the desired as $f(2)=-1$. $f(2)=-1$ can be obtained by $P(0,y)$ and by Lemma 1. Lemma 3: (Killer) $f(-x-f(x))=2(f(x)+x)+f(f(x)+x)$ if $f(1)=0$.
$\text{Proof of\,\,}\textcolor{red}{\textbf{\textsf{Claim 6}}}\text{:}$ By combining Lemma 2 and Lemma 3 we get that $$f(f(x)+x)=0=f(1)$$and by bijectivity of $f$, we finally conclude that $\boxed{f(x)=1-x}$ is the only solution to the Functional Equation. $\blacksquare$
04.07.2021 21:04
01.04.2022 04:58
Neat F.E. Let $P(x,y)$ the assertion of the given F.E.. We claim that $f(x)=1-x$ is the only solution to this F.E. Claim 1: $f$ is bijective Proof: Set $x \ne 0$ and then by $P \left(x,\frac{y-2f(x)}{x} \right)$ $$f \left(xf \left(\frac{y-2f(x)}{x} \right)-f(x) \right)=y \implies f \; \text{surjective}$$Now assume that $f(a)=f(b)$ then by comparing $P(x,a)$ and $P(x,b)$ for $x \ne 0$ $$ax=bx \implies a=b \implies f \; \text{injective}$$Hence $f$ is bijective aa desired. Claim 2: $f(1)=0$ and $f(0)=1$ Proof: Using Claim 1 we can let $c,d$ such that $f(c)=0$ and $f(d)=1$, then by $P(c,d)$ $$cd=0 \implies c \; \text{or} \; d =0$$Case 1: $c=0$ Then by $P(x,0)$ and surjectivity $$f(-f(x))=2f(x) \implies f(t)=-2t \; \forall t \in \mathbb R$$Which doesnt work hence we got a contradiction. Case 2: $d=0$ Then by $P \left(c,\frac{1}{c} \right)$ and Claim 1 $$cf \left(\frac{1}{c} \right)=0 \implies c^2=1 \implies c= \pm 1$$Case 2.1: $c=-1$ Now by $P(0,y)$ $$0=f(-1)=2 \; \text{contradiction!!}$$Case 2.2: $c=1$ So we got $f(1)=0$ and $f(0)=1$ so our claim is complete. Finishing: First we will get $f$ involutive by $P(1,x)$ $$f(f(x))=x \implies f \; \text{involution}$$Now the brute force part begins, as at this moment i have no idea what to do i will spam until i get something that looks promicing, which is afterall probably the main idea lol. $P(x,0)$ $$f(x-f(x))=2f(x)$$$P(x,2)$ (becuase $f(2)=-1$ as $f$ is involutive) $$f(-x-f(x))=2x+2f(x)$$$P(f(x),0)$ $$f(f(x)-x)=2x$$$P(f(x),1)$ $$f(-x)=2x+f(x)$$Now this along with a previous equation and the injectivity yeld $$f(x+f(x))=-2x-2f(x)+2x+2f(x)=0 \implies x+f(x)=1 \implies f(x)=1-x$$Hence $\boxed{f(x)=1-x \; \forall x \in \mathbb R}$ is the only function that works, so we are done
05.06.2022 21:29
Clearly $f$ is bijective. Let $f(n)=0$ then $P(n,0)$ and $P(n,n)$ gives $f(-1)=0$ or $f(0)=0$ or $f(1)=0.$ A. $f(-1)=0:$ Then compare $P(x,-1)$ with $P(-1,x)$ to get $f(x)=0,$ which fails. B. $f(0)=0:$ Then $P(x,0)$ gives $f(x)=-2x,$ also fails. C. $f(1)=0:$ Then $f(0)=1.$ And $P(1,x)$ gives $f$ is an involution. Moreover $P(0,2)$ provides $f(2)=-1.$ Now injectivity and $P(x,2)$ compared with $P(f(x),1)$ forces $f(x)=1-x,$ which infact works.
08.11.2022 19:43
Let's hope I didn't make a silly mistake again Let $P(x,y)$ be the asssertion of the given f.e. Note that by $P(1,y)$ we have $f(f(y)-f(1))=2f(1)+y$, since RHS varies in real numbers, $f$ is surjective, and since if $ \exists a \neq b: f(a)=f(b)$, using the latter equation we have $2f(1)+a=2f(1)+b$, contradiction, hence $f$ is bijective. Since function is surjective, $\exists c: f(c)=0$. Then $$P(c,0):f(cf(0))=0$$But since $f$ is injective, we must have $cf(0)=c$, so either $f(0)=0$ or $f(0)=1$. If $f(0)=1$, we have: $$P(1,1): f(0)=2f(1)+1 \Rightarrow f(1)=0 \Leftrightarrow c=1$$Then going back to $P(1,y)$, we have $f(f(y))=y$, which means $f(x)=f^{-1}(x)$, which means $f$ is involution function. Note that $P(0,y)$ gives $f(-1)=2$, and $f(2)=-1$ by involution. Now we spam $f(x)$ as variable and hope we get something useful. \begin{align*} &P(f(x),1): f(-x) = 2x+ f(x) \\ &P(f(x),2):f(-f(x)-x)=2x+2f(x) \end{align*}Let $x+f(x)=y$. Notice from $P(f(x),2)$ that $f(-y)=2y$ But from $P(f(x),1)$ we know that $f(-y)=2y+f(y)$, hence $2y+f(y)=2y \leftrightarrow f(y)=0$. Hence $y=1$, which gives us $\boxed{f(x)=1-x}$ which is satisfying our problem. For the case $f(0)=0$, we have: \begin{align*} &P(x,0):f(-f(x))=2f(x) \Rightarrow f(y)=-2y \end{align*}But it does not satisfy the equation, hence contradiction. Therefore $\boxed{f(x)=1-x}$ is the only solution.
08.02.2023 13:39
This lemma also kills the problem https://artofproblemsolving.com/community/c3037128h2864292_cde_lemma
22.09.2024 20:14
Let $P(x,y)$ denote the given assertion. And let $f(1)=c$. One can also quickly note that $f$ is injective. $\bullet$ $P(1,y)\Rightarrow f(f(y)-c)=2c+y$ $(1)$ $\bullet$ $P(x,f(y)-c)\Rightarrow f(xy+2cx-f(x))=2f(x)+xf(y)-cx$ $(2)$ Putting $x=1$ in this equation yields $f(y+c)=f(y)+c$. Suppose that $c\neq 0$, plugging $y\mapsto y+c$ in $(2)$ gives $$f(xy+3cx-f(x))=2f(x)+xf(y)=f(xf(f(y))-f(x))$$ Since $f$ is injective, this gives $y+3c=f(f(y))$, in particular $f$ is surjective. Plugging $y\mapsto f(y)$ in $(2)$ gives $$f(xf(y)+2cx-f(x))=2f(x)+xy+2cx=f(xf(y)-f(x))+2cx$$ Since $f$ is surjective, this gives $f(xy+2cx-f(x))=f(xy-f(x))+2cx$. Plugging $x=1$ into the last equation gives $$f(y+c)=f(y-c)+2c=y+4c$$ Hence $f$ is linear. This gives the solution $f(x)=1-x$. Otherwise, if $c=0$, $(2)$ becomes $f(xy-f(x))=2f(x)+xf(y)$ so plugging $y=-1$ in here gives $f(-x-f(x))=2f(x)+xf(-1)$. Now $x\mapsto f(x)$ yields $2f(x)+xf(-1)=2x+f(x)f(-1)$ so $f(-1)=2$ or $f$ is linear. Since we have dealt with the latter, suppose that $f(-1)=2$. Also $P(1,y)$ gives $f(f(y))=y$. $\bullet$ $P(f(x),f(1))\Rightarrow f(f(x)-x)=2x=f(f(2x))$ so $f(2x)=f(x)-x$ $\bullet$ $P(2,f(x/2))\Rightarrow f(x+1)=2f(x/2)-2=2f(x)+x-2$ Now let $g:\mathbb R\to \mathbb R$, $g(x)=f(x)+x$. From the above, we get $g(2x)=g(x)$ and $g(x+1)+1=2g(x)\iff g(x+1)-1=2(g(x)-1)$ so inducting gives $g(x+n)=2^ng(x)-2^n+1$. Notice that $(2)$ turns into $g(xy-g(x)+x)=g(x)+xg(y)-x$ so plugging $y\mapsto 2y$ gives $f(2xy-g(x)+x)=g(xy-g(x)+x)$. Now letting $x=2$ and $y\mapsto \frac{y}{2}$ gives $g(2y+3)=g(y+3)=g(2y+6)=8g(2y+3)-7$ so $g(x)=1$ for all $x$. Therefore, $f(x)=x-1$ $\forall x\in\mathbb R$ which does satisfy the given FE.
22.09.2024 23:23
Denote with $P(x,y)$ the assertation into $f(xf(y)-f(x))=2f(x)+xy$ $P(1,y)\Rightarrow$ $f$ is surjective If $f(a)=f(b)$, then comparing $P(1,a), P(1,b)$ gives us $a=b \Rightarrow$ $f$ is bijective. Let $t,r\in\mathbb{R}$ be s.t. $f(t)=0,f(r)=1$. $P(t,r)\Rightarrow 0=rt$ If $f(0)=0$, then $P(x,0)$ gives us $f(-f(x))=2f(x)$. $P(-f(x),3)\Rightarrow f(-f(x)f(3)-2f(x))=f(x)\Rightarrow (-f(3)-2)f(x)=x \Rightarrow f(x)=cx$ Checking the last we see that it's impossible, hence $f(0)=1$. $P(0,0)\Rightarrow f(-1)=2$ $P(t,t)\Rightarrow 1=f(0)=t^2 \Rightarrow f(1)=0$ $P(1,-1)\Rightarrow f(2)=-1$ $P(1,y)\Rightarrow f(f(y))=y$ Let $A=\{x \mid f(x)=-2x\}$. Now let $a\in A$: $P(f(a),1)\Rightarrow f(-a)=2a+f(a)=0 \Rightarrow a=-1$ $P(x,2)\Rightarrow f(-x-f(x))=2f(x)+2x \Rightarrow -x-f(x)\in A \Rightarrow -x-f(x)=-1 \Rightarrow \boxed{f(x)=1-x}$
08.11.2024 10:44
\[f(xf(y)-f(x))=2f(x)+xy\]Only function is $f(x)=1-x$. Let $P(x,y)$ be the assertion. By changing $y$, we see that $f$ is surjective. Also $f(a)=f(b)$ would imply $ax=bx$ or $a=b$ hence $f$ is also injective. Claim: $f(1)=0$. Proof: Let $f(1)=c$ and $f(a)=0$. $P(a,y)$ yields $f(af(y))=ay$. Thus, $f(0)=f(af(a))=a^2$ and $f(a^3)=f(af(0))=0=f(a)$ hence $a\in \{-1,0,1\}$. \[P(1,-c): \ \ f(f(-c)-c)=2c-c=c=f(1)\implies f(-c)=c+1\]\[P(x,\frac{y-2f(x)}{x}): \ \ f(xf(\frac{y-2f(x)}{x})-f(x))=y\]So left hand side does not depend on $x$. Hence \[f(xf(\frac{y-2f(x)}{x})-f(x))=f(f(y-2c)-c)\implies xf(\frac{y-2f(x)}{x})-f(x)=f(y-2c)-c\]Subsituting $x,y+2c$ yields $xf(\frac{y+2c-2f(x)}{x})=f(x)+f(y)-c$. If we choose $f(y)=c-f(x)$, then $y+2c-2f(x)=ax$ thus, $f(ax+2f(x)-2c)+f(x)=c$ for $x\neq 0$. If $a=0$, then $f(2f(x)-2c)+f(x)=c$. Since $f$ is surjective, we can replace $x$ with $f(x)$ which implies $f(2x-2c)+x=c$ or $f(x)=c-\frac{x+c}{2}=\frac{c-x}{2}$ which is not a solution. Now suppose that $f(-1)=0$. Choose $x=a$ to conclude that $f(a^2-2c)=c$ hence $a^2=2c+1$. But $a=-1$ yields $c=0$ which contradicts with the injectivity. Thus, $f(1)=0$.$\square$ Plugging $x=1$ gives $f(f(y))=y$. \[f(xy-f(x))=2f(x)+xf(y)=f(f(2f(x)+xf(y)))\implies f(2f(x)+xf(y))=xy-f(x)\]\[f(2f(x)+xy)=xf(y)-f(x)=f(xy-f(x))-3f(x)\]Replace $y$ with $yx$ to see that $f(2f(x)+y)=f(y-f(x))-3f(x)$. Choosing $f(x),y$ yields \[f(2x+y)=f(y-x)-3x\iff f(y+3x)=f(y)-3x\iff f(x+y)+x=f(y)\]Picking $y=0$ implies $f(x)+x=1\iff f(x)=1-x$ as desired.$\blacksquare$