In the name of Allah the most Gracious and the most Merciful. According to Islamic belief, Allah created the world and all of its inhabitants for a specific purpose. The Quran states that Allah created the universe and everything in it in order to be worshipped. In Surah Al-Baqarah, verse 21, it says: "And He has subjected to you whatever is in the heavens and whatever is in the earth – all from Him. Indeed in that are signs for a people who give thought."
The purpose of life, according to Islam, is to worship Allah and follow His teachings. This includes living a virtuous and moral life, being kind and compassionate towards others, and striving to do good deeds. In Surah Al-Baqarah, verse 177, it says: "Righteousness is not that you turn your faces toward the east or the west, but [true] righteousness is [in] one who believes in Allah...and gives wealth, in spite of love for it, to relatives, orphans, the needy, the traveller, those who ask [for help], and for freeing slaves."
Overall, the purpose of creating the world and mankind, according to Islamic belief, is for the worship and service of Allah, and for the betterment of humanity. The Quran provides guidance and teachings on how to live a righteous and fulfilling life in accordance with Allah's will.