Non-believers are unable to provide any convincing reason for the existence of this universe or of human life. People who believe there is a Creator assume that creation occurred by His will. But in a world where everything is shown to have a purpose, it is natural for a human being to wonder about the purpose of his own creation. One is surely justified in expecting the Creator who put us on this earth to inform us why He did so and what He expects of us.
The Qur’an informs us that He did just that. It says God created us for a test here on earth, conveying His words:
“Then did you think that We created you uselessly and that to Us you would not be returned?” 
A non-believer might decide that the objective of his life will be to collect wealth, obtain position or pursue pleasure to the greatest extent possible. But none of this will benefit him in the long run. According to His final scripture, God created man to test him with certain responsibilities . He did not intend life on this earth to necessarily be comfortable or satisfying but merely a trial of limited duration, the punishment and rewards of which will be due in the Hereafter.
As mentioned previously, most of creation is «Muslim» in that it is programmed to obey the physical laws set by God, and (his is why the universe functions with balanced equilibrium. Man, however, was given a free will and the ability to either obey or disobey. But God will not allow His universal balance lo be upset indefinitely by defiant, corrupt and sinful people, so He only grants human beings a measure of freedom in a temporary world. The scheme of birth, development, decline and death provides each with the opportunity to prove to himself without a doubt what he will deserve on the Day of Judgement, which God created for the manifestation of His ultimate justice.
This life is very meaningful and purposeful to the believing Muslim because he realizes that it will determine his outcome and permanent position in the next life. He lives to earn the approval of his Creator in preparation for the final return to Him.
We all recognize that people make things to perform specific functions for them, in other words, to serve them. God has made us to serve Him, but with one major difference; it is not for the benefit of the Creator Himself but for the benefit of us, His creation. The purpose of our existence is thus stated in the Qur’an:
“I did not create the jinn and mankind except to worship Me.” 
But man’s worship of God is not automatic like the vast majority of created beings but by his own choice and effort, and this is what entitles him to honor and reward.
How should one worship God in order to fulfill that purpose? This question can undoubtedly best be answered by Him. God has provided every element of His creation, living and inanimate, with guidance. We can thus expect that He would provide us with guidance as well. His revelation instructs humanity what to do, what to avoid, and the reason for it. It informs man what is expected of him, how to accomplish it, and the results of continual positive effort. Through Prophet Muhammad, God revealed to man the ways of worship suitable to his physical and psychological nature and individual talents, and in harmony with his particular role on the earth. These, in combination, are what enable Him to fulfill the purpose of His creation.
1 23:115-1 16.
2 As stated in 18:7, 67:2 and 76:2.