Radius of hollow sphere is R/2, so mass in this hollow portion would had been, M/8.
Now net force on m due to whole sphere = force due to remaining mass + force due to cavity mass.
Force due to remaining mass = force due to whole sphere = force due to cavity mass