I am trying to solve the following first order differential equation: $$ g'(R)=-2 \sqrt{R^2-g(R)}+2 R$$
By direct substitution it can be verified that an obvious solution is $$g(R)=R^2.$$
However, when doing the transformation $y(R)=R^2-g(R)$, we get $$y'(R)=2 \sqrt{y(R)} $$ which is separable and gives (for some constant $C$): $$\int \frac{dy}{2y^{1/2}}=R+C $$ or $$y^{1/2}= R+C,\\ y=(R+C)^2.$$ Remembering that $y(R)=R^2-g(R)$ we finally get $$ g(R)= -C^2-2C R .$$
I also tried solving it with Mathematica, but it also misses the other solution.
So, my question is where did the obvious solution $g(R)=R^2$ go?
You forgot to check the case where $y=0$ in solving $y'=2\sqrt y$. When you solve this differential equation generally you implicitly assumed $y\ne0$ (because you have a divison by $\sqrt y$ in the integral form).