I tried a lot for the last 2 days but couldn't solve it

My progress:

Let us denote the functional equation with (1)

Let $x=0 $in (1)

Then,

$f(0)=f(yf(0)) \cdots (2) $

let $f(0) \neq 0$ then $f(0)=c$ for some real constant c

Using (2) we can change y as whatever we want and get all real numbers in the input of ther R.H.S but the L.H.S remains the same. Then $f(x)$ is a constant function that obviously not true.CONTRADICTION

$\therefore f(0)=0$

Now putting $y=0$ in (1) we get,

$f(xf(x))=f(0)+x^2$

Or,$f(xf(x))=x^2 \cdots (3)$

Or,$f(f(1))=1[x=1]$

Putting x=f(1) in (3) we get,

$f(f(1)f(f(1)))=f(1)^2$

Or,$f(f(1))=f(1)^2[f(f(1))=1]$

Or$f(1)^2=1$

Or,$f(1)= \pm 1$

Finally putting $x=1$ in (1) we get,

$f(f(y+1))=f(\pm y)+1$

-----------------------------------------------

From here I got no progress

But if we can get $f(f(x))=x$[I couldn't get it so it might be a wrong way to go] we can use it in(3) when x=f(t),

and get $f(t)^2=t^2$ and then get $f(t)=\pm t $ which is indeed the answer.

Let $x=0 $in (1)

Then,

$f(0)=f(yf(0)) \cdots (2) $

let $f(0) \neq 0$ then $f(0)=c$ for some real constant c

Using (2) we can change y as whatever we want and get all real numbers in the input of ther R.H.S but the L.H.S remains the same. Then $f(x)$ is a constant function that obviously not true.CONTRADICTION

$\therefore f(0)=0$

Now putting $y=0$ in (1) we get,

$f(xf(x))=f(0)+x^2$

Or,$f(xf(x))=x^2 \cdots (3)$

Or,$f(f(1))=1[x=1]$

Putting x=f(1) in (3) we get,

$f(f(1)f(f(1)))=f(1)^2$

Or,$f(f(1))=f(1)^2[f(f(1))=1]$

Or$f(1)^2=1$

Or,$f(1)= \pm 1$

Finally putting $x=1$ in (1) we get,

$f(f(y+1))=f(\pm y)+1$

-----------------------------------------------

From here I got no progress

But if we can get $f(f(x))=x$[I couldn't get it so it might be a wrong way to go] we can use it in(3) when x=f(t),

and get $f(t)^2=t^2$ and then get $f(t)=\pm t $ which is indeed the answer.