Hi Carly,
To determine the Sun's interior temperature scientists have develop models based on physics and what we know about the Sun's age, mass, volume, and light output. For instance, the only energy source we know of that could keep the Sun going for billions of years is nuclear fusion.
We can use these things to calculate the temperature and density as a function of radius in the sun.
(see
http://solarscience.msfc....a.gov/interior.shtml for examples)
In the last couple decades we have also started studying the solar interior by studying solar vibrations (this is called helioseismology). What we have found that way backs up the solar interior models pretty well.
cheers,
Terry