Setting x = y = 0, we get f(0) = f2(0) which means f(0) = 0 or f(0) = 1
Swapping x and y we get
f[(y-x)2] = f[(x-y)2] = f2(y) - 2y f(x) + x2
Hence we get f2(x) - 2x f(y) + y2 = f2(y) - 2y f(x) + x2
Now putting y = 0, we get f2(x) - 2x f(0) = f2(0) - x2
If f(0) = 0, then f2(x) = x2 and we get f(x) = x after discarding f(x) = -x as extraneous
Likewise, if f(0) = 1, then f(x) = x+1 satisfies the given equation