This is a tricky queston since we cannot go with a thermometer to the Sun! The solar surface temperature is more straightforward. The sun emits radiation from X-ray to radio waves. There is a relationship between the amount of radiation at different wavelenghts and the temperature of the Sun (called Planck's law of radiation). For core temperature 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.
Emilia