2. \(f(x+f(y)+3xf(y))=x+3xy+y\) for any \(x,y\in\mathbb{R}\)
\(P(0,x)\Longrightarrow f(f(x))=x\) that is, \(f\) is injective. Let \(f(0)=c\) be a constatnt.
\(P(x,0): f(x+f(0)+3xf(0))=x=f(f(x))\Longrightarrow (3c+1)x+c=x+f(0)+3xf(0)=f(x)\) as \(f\) is one-to-one function.
After replacing this \(f\) into the original equation gives \(f(x)=x\) is the only solution.
3. \(f:\mathbb{R}\rightarrow\mathbb{R}\) such that \(f(xf(y)+x)=xy+f(x)\)
We see that \(f(xf(y)+x)=xy+f(x)\) with the equation \(f(xf(z)+x)=xz+f(x)\). Let \(f(y)=f(z)\), we can choose \(x\not=0\). Hence, \[0=f(xf(y)+x)-f(xf(z)+x)=\Big(xy+f(x)\Big)-\Big(xz+f(x)\Big)=x(y-z)\Longrightarrow y=z\]Or equivalently, \(f\) is injective. \(P(x,0): f(xf(0)+x)=0+f(x)=f(x)\rightarrow xf(0)+x=x\rightarrow f(0)=0\)
Consider that, \(P(1,y-f(1)): f(f(y-f(1))+1)=y\) which means that \(f\) is surjective. There exist \(t\) such that \(f(s)=-1\)
\(P(x,s): 0=f(xf(s)+x)=xs+f(x)\Longrightarrow f(x)=-sx\).
Replace in the original we get \(f(x)=x,-x\) are the solutions.