Satan's role in our lives
Allah ﷻ is a creator, He creates what He wills and each creation serves its own purpose. No creation on this earth or in the entire universe has been created without a purpose. Humankind has its own purpose to serve, satan has its own purpose to serve, animals, plants, insects etc. they all serve their individual purposes.
Satan is one of the jinns (invisible beings), who like humans carry free will to either obey or disobey the will of Allah ﷻ. In Islam Allah ﷻ has the pre-eternal knowledge of His entire creation including satan, and also Adam (alaihi salaam) and his descendants. Satan’s or Adam’s disobedience in the pre-eternal knowledge of Allah ﷻ does not mean the predestination of their acts. Their acts of obedience or disobedience are based on their God given free-will hence the concept of rewards or punishment and blessed or unfortunate, in this life or hereafter. Rewards or punishments, paradise or hellfire in hereafter would make no sense if all acts were predestined. By exercising his free will, satan chose to disobey the commandment to show respect to Adam (a.s) . He became arrogant and decided to disobey when Adam (a.s) and his descendants were honored with the title of Allah’s best creation and to become His successors on earth.
The Islamic perspective does not necessitate the creation of satan for humankind test on earth, which even many Muslims mistakenly think. It is very true that satan’s disobedience and challenge to Allah ﷻ to misguide humankind is mentioned in the Quran and fits in the overall picture of humanity’s test on earth. However, that does not in any way imply that satan is our greatest enemy and test. In fact our greatest enemy is our own Nafs (evil commanding soul), the opposing force within each human which invites us towards disobedience of Allah ﷻ (for more info please read The Mystery of Human Soul). Allah ﷻ created duniya(materialistic word) as a testing ground in which our Nafs plays the major role of keeping us attached to it and forgetting the hereafter. Yes, satan too is our enemy and contrives to misguide many among humankind and jinns, yet his influence over us in relation to our own nafs is very nominal. The Quran teaches that on the Day of judgment satan will admit his success in misguiding many, but will attribute that success not to his sole efforts, but to our nafs (evil within our soul): “And satan will say when the matter has been concluded (on the day of judgment), ‘Indeed, Allah had promised you the promise of truth. And I promised you, but I betrayed you. But I had no authority over you except that I invited you, and you responded to me. So do not blame me; but blame yourselves (Anfus plural of Nafs). I cannot be called to your aid, nor can you be called to my aid. Indeed, I deny your association of me [with Allah] before. Indeed, for the wrongdoers is a painful punishment.’”
Allah ﷻ in His Eternal Mercy has not given satan the free hand to control us, he has no power over us. All he can do is invite us i.e. our souls and if we obey their evil inclinations, then we are led towards our own ruin. But every time we reject the temptation it creates within us to oppose Allah’s will, we achieve 'rewards' and those rewards are ultimate spiritual development the effect of which we see in our lives in the face of increased guidance, faith and nearness to Allah ﷻ and in the hereafter it is seen in the state of higher status in Paradise. Even though satan’s existence plays a vital role in our spiritual and intellectual development yet his existence does not necessitate the purpose of humankind creation. Satan is just another creation of Allah ﷻ like many others and has been created to serve his individual purpose and nothing more.
 In classical Arabic, the term duniya in its broader meaning comprises what we call the temporal world and its temptations as opposed to everlasting hereafter and its blessings.
 Al Quran 14:22