Why do people living in the equator have dark skin? I know that Melanin acts as a protective biological shield against ultraviolet radiation.
But doesn't black absorb all light in a way making the body more heated than the surroundings ?
It didn't, the basal condition for humans is dark skin, all other pigmentation patterns evolved from it. Additionally Dark skin is not monophyletic/homologous in humans, that is some darks skinned humans evolved from light skinned humans who in turn evolved from ancestral dark skinned humans, (Evolution made skin lighter then made it darker again in other regions). Skin dark/lightness is also well correlated with latitude (which is correlated with UV levels).
First it helps if you remember skin is translucent so even very light skin absorbs a great deal of light. Additionally black also radiated heat better than white its is a double edged sword so to speak, it absorbs heat better but also sheds it better.
But the current hypothesis about why light skin evolved is due to vitamin D. The skin absorbs some UV radiation to manufacture vitamin D. Dark skin blocks more of this radiation reducing vitamin D levels. As humans migrated into higher latitudes with less UV radiation they needed lighter skin to harvest more of it. If your skin is too light you have issues with sunburn, skin cancer, and folic acid destruction darker skin protects from these. Now in modern humans clothing and diet completely swamps these effects, so studying it is difficult. the use of clothing in humans moving into colder climates may have exacerbated this effect. The later evolution of lactase persistence could further confuse the effect.
Note that this hypothesis is controversial and only weakly supported because it is extremely difficult to test and the the multiple confounding factors.