4A. Determine all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ for which

$$
f(f(x y))=x f(y)+3 f(x y)
$$
Solution. If in the equation from the problem the variables $x$ and $y$ swap places, we get a new equation $f(f(y y))=y f(x)+3 f(y x)$. Since $x y=y x$, by equating we get $y f(x)=x f(y)$. If we now substitute $y=1$, we have $f(x)=f(1) x$. Further, if in the equation from the condition of the problem we substitute $x=1, y=1$, we get $f(f(1))=f(1)+3 f(1)$, that is, $f(f(1))=4 f(1)$. If in $f(x)=f(1) x$ we substitute $f(1)$ for $x$, we get: $f(f(1))=f(1)^{2}$, so $f(1)^{2}=4 f(1)$, from which we get $f(1)=0$ or $f(1)=4$. Finally, the solutions to the equation are the functions $f(x)=0$ and $f(x)=4 x$.