This is a very good question! And tricky since we cannot measure the temperature in the solar core from the solar spectrum like the surface temperature. However, we can get a simple approximation from the fact that the Sun is in equilibrium: the inward pressure by the gravity has to be balanced by the outward pressure from the solar energy output. Since we know the solar radius and the mass we can estimate the core temperature that is needed to hold the Sun up against gravity.