Praise be to Allah (The Glorified and Exalted).
1) The purpose of life is to worship Allah (The Glorified and Exalted) and serve Him by acts of obedience.
The reason man is to serve Allah (The Glorified and Exalted) alone is because this is part of the fulfillment of the
Amanah, and because of the reality that Allah (The Glorified) is the only one deserved of man’s veneration and worship,
“To Allah belongs whatsoever is in the heavens and the Earth. Verily, Allah, He is free of all needs, worthy of all praise” [31:26],
“His is the kingdom of the heavens and the earth. And to Allah return all the matters (for decision)” [57:5],
“Lord of the heavens and of the Earth, and of all that is between them; so worship Him, and be constant and patient in His worship: knowest thou of any who is worthy of the same Name as He?" [19:65]. A Believer lives his life in awe of the Supreme Being and the fact that the Ruler of the Universe gave him the honor of being created. Further, guided him to the straight path and allowed him to have immortal life in a state of bliss in the Hereafter, InshAllah.
Regarding the other important reasons for which mankind were created, Allah (The Glorified and Exalted) has created man and placed him in this world of trials and tribulations to also bring about the things which He loves such as: sublime principles of establishing Truth and Justice, humility in manners, gratitude, devotion, and sacrifice in the way of serving Him; charity, kindness, and mercy displayed among the creation toward one another; resilience and steadfastness in adhering to the path of right conduct, whether that is in the way of religion or worldly matters, and in general, dignified living in obedience to His Shariah (Laws). The man or woman that engrains these principles into his or her life in this world, in veneration of Allah, is rewarded with the Garden of Paradise.
The establishment of Justice is especially Beloved to the Almighty and is mentioned several times in the Qur'an:
“Allah doth command you to render back your Trusts to those to whom they are due; And when ye judge between man and man, that ye judge with justice: Verily how excellent is the teaching which He giveth you! For Allah is He Who Heareth and Seeth all things.”
[4:58]
“O ye who believe! Stand out firmly for justice, as witnesses to Allah, even as against yourselves, or your parents, or your kin, and whether it be (against) rich or poor: for Allah can best protect both. Follow not the lusts (of your hearts), lest ye swerve, and if ye distort (justice) or decline to do justice, verily Allah is well- acquainted with all that ye do.”
[4:135]
"O ye who believe! Stand out firmly for Allah, as witnesses to fair dealing, and let not the hatred of others to you make you swerve to wrong and depart from justice. Be just, that is next to piety, and fear Allah. For Allah is well-acquainted with all that ye do.”
[5:8]
“Civilization is rooted in justice, and the consequences of oppression are devastating. Therefore, it is said that Allah aids the just state even if it is non-Muslim, yet withholds His help from the oppressive state even if it is Muslim.” -Quote from the Scholar Ibn Taymiyah (may Allah have mercy on him)
The Muslims should become leaders in the world with regard to the establishment of such principles and moral conduct. This is the reason that Muslims blessed with greater understanding and resources should struggle in the establishment of such conduct. Whether that is by reforms in their home nations or teaching or doing various charities in their local communities. This life is not simply about eating, sleeping, going to work, and having a family. This life is about
striving and vacation is Paradise in the Hereafter. When the Muslims deviated from such practices, then you have what has appeared in modern times, punishment from Allah (The Exalted) because of chasing after the life of this world and not striving to live one's life based upon the principles and conduct condoned by Allah (The Glorified and Exalted).
2) For a creation like human beings, with their intellect, strong opinionated nature, curiosity, and fallacy, to worship and sacrifice and strive for the Cause of Allah (The Exalted), by establishing His principles on the Earth and living one's life in accordance to them, is a momentous challenge. This is why the Almighty has placed the human race above the Angels in terms of rank.
And Allah (The Glorified and Exalted) Knows Best.