How do scientists calculate and measure a stars mass, temperature, and elements?
They observe very closely using telescopes and also split the light into its constituent colours (or frequencies) using a device called a diffraction grating.
The temperature can be estimated from the colour, the splitting of light into a spectrum tells us what elements are present (they absorb at characteristic frequencies giving particular dark lines for each element) and gives much more detailed evidence of their surface temperature.
Mass is more tricky I think. As I understand it, it is estimated from absolute luminosity (brightness at a standard distance) unless planets are orbiting in which case the central mass can be calculated given the orbital period and radius.