It is called a Fourier series, and it works for any periodic waveform. Just as for a square wave, it is a way of computing the coefficients of an infinite series of sine waves consisting of a fundamental frequency and all of it's harmonics.
Well what do you think? You have to at least take a shot at trying before you get definitive answers here. That's because if you are given every answer you ask about you'll fail all your courses. You dont want that do you?
Someone already gave you a hint though, Fourier, Fourier reconstruction of a wave from its components. You should try to explain in more detail though.