Find all functions $f:\mathbb R\to\mathbb R$ such that $$f\left(x^2+f(y)\right)-y=(f(x+y)-y)^2$$holds for all $x,y\in\mathbb R$.
Source: IMOC 2018 A4
Tags: fe, functional equation, algebra
Find all functions $f:\mathbb R\to\mathbb R$ such that $$f\left(x^2+f(y)\right)-y=(f(x+y)-y)^2$$holds for all $x,y\in\mathbb R$.