In 300 (2006), why does Xerxes consider himself a god? Is there a back story for him somewhere?
Looking at the real Xerxes there doesn't seem to be a background suggesting that he ever claimed himself to be an actual god, apart from the mandatorily high self-esteem every great king and conqueror needs. Rather than that it is probably just that naturally high self-esteem exaggerated in a way congruent with the rest of the movie's plot and style.
As you probably know, the movie is not an entirely accurate rendition of the real historical events, but rather an artistically distorted and exaggerated version (upto the point of including fantasy elements), and told from the viewpoint of the Spartans. And in light of this exaggeration and subjective viewpoint it makes perfect sense to depict Xerxes as a god-like creature or someone who regards himself as a god. This is pretty in line with the whole depiction of the Persians as an invincible and ruthless army of millions (while tens of thousand would have been more accurate) and helps to emphasize both the contrast between them and the mere 300 Spartans with their more down-to-earth king Leonidas and the hopelessness of the Spartans' situation.
(Yet I also have to admit that this is an answer more based on common sense than elaborate research of the real events and the comic's/movie's development process.)
The historical Xerxes probably did not consider himself a god, but he was a legend in his own time.
He removed a golden statue from the temple of Zeus, desecrating the temple, something his father Darius did not dare to do.
From Herodotus, The Histories (Book 1, Chapter 183, Section 3)
and in the days of Cyrus there was still in this sacred enclosure a statue of solid gold twenty feet high. I myself have not seen it, but I relate what is told by the Chaldeans. Darius son of Hystaspes proposed to take this statue but dared not; Xerxes his son took it, and killed the priest who warned him not to move the statue.
When a bridge, built by Xerxes' engineers, was destroyed by a storm on the Hellespont, Xerxes ordered his men to punish the waters.
Again from Herodotus (Book 7, Chapter 35, Section 1)
When Xerxes heard of this, he was very angry and commanded that the Hellespont be whipped with three hundred lashes, and a pair of fetters be thrown into the sea. I have even heard that he sent branders with them to brand the Hellespont.
As a man, he was regarded as exceptionally handsome. As a king, he had gathered an enormous army (Herodotus claims in excess of 1 million, modern scholars estimate 60-150,000) and marched it across western Asia and into Europe. Regardless of the actual number, he was a living legend.
Unfortunately, movies have a tendency to make everyone bigger than life. So when it's time to portray a person that actually was bigger than life, the only choice is hyperbole and exaggeration. Take Xerxes' actual accomplishments and audacity, and combine that with the idea that some ancient rulers tried to cloak themselves in deity, and it isn't too much of a stretch to portray him as was done in 300.
In the new film 300: Rise of an Empire, Xerxes' father's dying words were
only a god can defeat the Greeks.
Spurred on by Eva Green's character, Artemisia, he gets wrapped in chains and gauze inscribed with Sumerian text and wanders into the desert until he finds a cave with a pool of gold liquid, upon exiting the pool, he now has flaming red eyes, is hairless and is now a foot taller. Literally a god king.
Actually, He had never considered himself a god. They were Zoroastrian (a religion that still exists in Iran and is considered to be monotheistic and acceptable by the Iranian Islamic government) and they were extremely religious and it was a big taboo for them to consider themselves god or anything with extraterrestrial power. In the inscriptions that have been found in the remainder of their constructions in Alvand, Persepolis and Susa which is addressed by archaeologists as XPa, XPb, XPc, XPd, XPe, XPf ("Harem inscription"), XPg, XPh ("Daiva inscription"), XPi, XPj, XPk, XPl, XPm....
There is a repetitive initiation for most of his speeches in the worship of Ahuramazda (Zoroastrian God) and also pray for their protection. That sounds to me that those are the words of a ruler who is so confident but no sign of claim of being a god. In a text inscribed on the walls of the Gate of all nations in Persepolis (also known as Takht-e-Jamshid), at the main gate, there is an inscription known as XPa, that Xerxes (Persian name: Khashayar-shah) introduced himself:
A great god is Ahuramazda, who created this earth, who created heaven, who created man, who created happiness for man, who made Xerxes king, one king of many kings, commander of many commanders. I am Xerxes, the great king, the king of kings, the king of all countries and many men, the king in this great earth far and wide, the son of Darius, an Achaemenid. King Xerxes says: by the favor of Ahuramazda this Gate of All Nations I built. Much else that is beautiful was built in this Persepolis (Pârsâ), which I built and my father built. Whatever has been built and seems beautiful - all that we built by the favor of Ahuramazda. King Xerxes says: may Ahuramazda preserve me, my kingdom, what has been built by me, and what has been built by my father. That, indeed, may Ahuramazda preserve. http://www.livius.org/aa-ac/achaemenians/XPa.html
No need to explain how religious and God-fearing they are. Also about how he was portrayed in the movie, there was a common appearance for men that we see in all the ancient art from that age, long and curly beard that truly has nothing to do with the chosen ORIFLAME make-up for King Xerxes.
Besides, how the movie tried to show the ancient Persians opinion about women and make it impressive by emphasis on respectful behaviour of Greek king with his queen (damn Cersei :)), was a bit disturbing for me because we know that the females of the royal family in ancient Persia were powerful as we know their names and their stories and deeds. Xerxes was not the eldest son of Darius and he would not have be a king if the queen his mother Atossa had not had the authority within Achaemenian imperial house and court.
That back story is explained in 300: Rise of an Empire (2014) where Xerxes, at the behest of Artemisia bathes in some liquid of the Gods, emerging as the "God-King".