Solution by AIME4096.
We claim that the only solutions are f(x)≡0 and f(x)=x. Both functions clearly satisfy f(f(x2)+yf(x))=xf(x)+xf(y) for all x,y∈R. We now show that these are the only solutions. Let P(x,y) denote the assertion f(f(x2)+yf(x))=xf(x)+xf(y).
Lemma 1. Either f≡0, or f(0)=0 and 0 is the unique zero of f.
Proof. Assertion P(0,y) gives f(f(0))=0. Suppose that there exists some a=0 such that f(a)=0. Then P(a,y) gives f(f(a2)+yf(a))=af(a)+af(y). Since f(a)=0, this becomes f(f(a2))=af(y) for every y∈R. Taking y=0 gives f(f(a2))=0, and therefore af(y)=0 for every y∈R. Since a=0, we conclude that f(y)=0 for every y∈R. Hence f≡0. Thus, for every nonzero solution, f(x)=0 implies x=0. Since f(f(0))=0, the uniqueness of the zero gives f(0)=0. Therefore, from now on, assume f≡0. Then f(0)=0 and x=0 implies f(x)=0. □
Lemma 2. Every nonzero solution is odd.
Proof. Let a=f(1). Since 1=0, Lemma 1 gives a=0. Setting x=1 in P(x,y) gives f(f(1)+yf(1))=f(1)+f(y), so.
f(a+ay)=a+f(y). Taking y=−1 gives f(0)=a+f(−1). Since f(0)=0, we obtain f(−1)=−a. Now set assertion P(−1,y). Since f(1)=a and f(−1)=−a, we obtain f(a−ay)=a−f(y). On the other hand, assertion P(−1,−y) yields f(a−ay)=a+f(−y). Comparing the two expressions for f(a−ay) gives a−f(y)=a+f(−y), and therefore f(−y)=−f(y) for every y∈R. □
Lemma 3. For every x∈R, f(x2)=xf(x).
Proof. Set assertion P(x,−x). By Lemma 2, we get
f(f(x2)−xf(x))=xf(x)+xf(−x)=0.
By Lemma 1, f(x2)−xf(x)=0, so f(x2)=xf(x) for every x∈R. □
Lemma 4. Every nonzero solution is idempotent for every x∈R.
Proof. Setting P(x,0) gives f(f(x2))=xf(x). By Lemma 3, xf(x)=f(x2), so f(f(x2))=f(x2). Since every nonnegative real number is of the form x2, we have f(f(t))=f(t) for every t≥0. Now let t<0. Since f is odd,
f(f(t))=f(−f(−t))=−f(f(−t)).
Because −t>0, the result already proved gives f(f(−t))=f(−t). Therefore f(f(t))=−f(−t)=f(t). The case t=0 is immediate because f(0)=0. Hence f(f(x))=f(x) for every x∈R. □
Lemma 5. For every x,y∈R, f(f(x)(x+y))=x(f(x)+f(y)).
Proof. By Lemma 3, f(x2)=xf(x). Substituting this into P(x,y) gives
f(xf(x)+yf(x))=xf(x)+xf(y),
where simply factoring proves the lemma. □
Lemma 6. For every x∈R, f(x−f(x))=x−f(x).
Proof. The statement is immediate when x=0. Now let x=0 and put a=0=f(x). By Lemma 4, f(a)=f(f(x))=f(x)=a. Apply Lemma 5 with P(a,y). For every u∈R, f(a(a+u))=a(a+f(u)). Choose u=x+y−a. Then a+u=x+y, so f(a(x+y))=a(a+f(x+y−a)). On the other hand, Lemma 5 applied to x gives f(a(x+y))=x(a+f(y)). Hence
x(a+f(y))=a(a+f(x+y−a)).
Now set y=0. Since f(0)=0, xa=a(a+f(x−a)). Because a=0, division by a gives x=a+f(x−a). Since a=f(x), this becomes f(x−f(x))=x−f(x).
.□
Lemma 7. Every nonzero solution is the identity function.
Proof. Let d=x−f(x)=f(d). Since f(x)=x−d, we can apply Lemma 3 to obtain f(x2)=x(x−d)=x2−xd. Therefore x2−f(x2)=xd. By Lemma 6 applied to x2, f(x2−f(x2))=x2−f(x2). Thus f(xd)=xd
for every x∈R. Suppose there exists some x0∈R such that d0=x0−f(x0)=0. Then f(xd0)=xd0 for every x∈R. Since d0=0, every r∈R can be written as r=xd0 for some x∈R. Hence f(r)=r for every r∈R. Thus f(x)=x for all x∈R. If no such x0 exists, then x−f(x)=0 for every x, so again f(x)=x for every x∈R. □
Therefore the complete solution set is
f(x)≡0 or f(x)=x∀x∈R.
as desired. ■