Problem

Source: 2023 Grand Duchy of Lithuania, MC p1 (Baltic Way TST)

Tags: functional equation, algebra



Given a non-zero real number $a$. Find all functions $f : R \to R$, such that $$f(f(x + y)) = f(x + y) + f(x)f(y) + axy$$for all $x, y \in R$.