I have been thinking about something I learned recently. The Jewish understanding of how Satan works mainly is derived from the Keturim/Writing of the Book of Iyov/Job. I learned that the angel Sama-kel has three functions, he acts as an individuals yetzer hara, as the angel of death, and as the heavenly prosecutor on the day of judgement.
This is learned from the Daf Yomi tractate Bavra Batra 16a-b:
http://www.ou.org/shabbat_shalom/article/masechet_bava_batra_14a20b/Bava Batra 16a-b
As we learned above (daf, or page, 14) according to the baraita, Moshe wrote the book of Iyov (Job). Our daf - almost in its entirety - is devoted to a Rabbinic reading of the book of Iyov.
Our Gemara quotes the introductory story in Iyov, where the satan approaches G-d, telling him that no one alive in the world reaches the level of devotion and belief in G-d possessed by Avraham Avinu. In response G-d points to Iyov, against whom, G-d laments, the satan instigated G-d to destroy him without cause (see Iyov 2:3).
In response to this passage, Rabbi Yohanan says ilmale mikra katuv, ee efshar le-omro - were it not for the written text, we would not be allowed to say it - i.e. we would not be allowed to suggest that G-d has human traits like being instigated into doing something that He did not intend to do. The implication is that Iyov's test was not part of a contest between G-d and the satan, rather it was part of G-d's test of Iyov whose purpose was to strengthen Iyov by challenging his beliefs. The Maharal explains that the satan in this story is a representation of evil in the world. G-d created a world that includes evil and just as G-d allows the will of all of His creations, He allowed the will of evil, as well.
Quoting a series of passages, Resh Lakish says: hu satan, hu yetzer ha-ra, hu malakh ha-mavet -- the satan of the Iyov story, the evil inclination, the angel of death are all one and the same. The Maharal suggests that this can be understood as a statement of the different manifestations of evil in the world. The evil that operates within every human soul (the yetzer ha-ra) is the very thing that plays the role of prosecutor against the person (the satan), which is ultimately the evil force that destroys life (the malakh ha-mavet).
As I always point out in discussions of HaSatan, he doesn't function outside of Hashems realm and he acts as the one who tests us, to see if we truly love Hashem which is exhibited in our actions and performance of mitzvot.