It is given that the mass of Earth compacted into a small spherical ball and setting
the acceleration due to the gravity of Earth is equal to the acceleration due to the gravity of the Sun. Therefore,
\(\begin{aligned}{g_E} &= {g_S}\\\frac{{G{M_E}}}{{{R^2}}} &= \frac{{G{M_S}}}{{R_s^2}}\\\frac{{{M_E}}}{{{R^2}}} &= \frac{{{M_S}}}{{R_s^2}}\end{aligned}\)
Where \({M_E}\) is the mass of Earth (\(5.98 \times {10^{24}}\;{\rm{kg}}\)), \({M_S}\) is the mass of the Sun (\(2 \times {10^{30}}\;{\rm{kg}}\)), \({R_S}\) is the solar radius (\(6.955\; \times {10^8}\;{\rm{m}}\))
\(R = \)the radius of the new sphere
\(\begin{aligned}{R^2} &= \frac{{{M_E}R_S^2}}{{{M_S}}}\\ &= \frac{{\left( {5.98 \times {{10}^{24}}\;{\rm{kg}}} \right) \times {{\left( {6.955 \times {{10}^8}\;{\rm{m}}} \right)}^2}}}{{2 \times {{10}^{30}}\;{\rm{kg}}}}\\ &= \;1.446\; \times \;{10^{12}}\;{{\rm{m}}^2}\end{aligned}\)
Therefore, the radius is given by:
\(\begin{aligned}R &= \;\sqrt {1.446\; \times \;{{10}^{12}}\;{{\rm{m}}^{\rm{2}}}} \\ &= \;1.20 \times \;{10^6}\;{\rm{m}}\end{aligned}\)
So, the radius of the new sphere is \(R = 1.20 \times {10^6}\;{\rm{m}}\).