Solomon marries Pharaoh's daughter. If you'll remember, god spent a lot of time in the book of Exodus making Pharaoh refuse to let the Israelites leave, then punishing him for it. Then he expressly forbid the Israelites from marrying people of other races, lest they tempt them into worshiping false idols. Living biblically must be so darned confusing! Or rather, Solomon's the king, so he can do whatever the hell he wants. Rules are for little people.
Anyway, at some point that temple god spent all those chapters designing with the taste of a 12 year old girl has been destroyed and the people sacrificed in high places, because there was no house built unto the name of the LORD, until those days. (v.2) Solomon is a loyal sacrificer, too, going so far as to sacrifice a thousand freaking animals one day in Gibeon. God loves this of course, so when Solomon goes to sleep that night, he appears to him in a dream and asks him what he wants. Three more wishes!
Solomon, of course is full of false modesty, saying how his father was so great and he's just a dumb fuck. Well, he proved that in chapter 2, didn't he. So he asks for wisdom, which god instantly grants, along with wealth and power and a long life. It would appear our little Solomon has wised up some even without god's help.
Solomon wakes up and has another barbecue. Then he has a chance to make his first judgement: the two women fighting over a baby. What they didn't tell you in Sunday school: they're hookers. And people wonder why there are no good film roles for women. Even in the bible, you could only be a virgin or a whore.
So anyway, the two woman both make the same claim: we each had a baby at the same time, then hers died and she stole mine while I was asleep. Solomon listens to their back and forth for a bit, then orders his minions to bring him a sword. He instructs them to cut the baby in two and give a piece to each of them. Of course then the 'real' mother says no, give it to her, and the king tells the minions to give it to her. The Israelites are easily impressed and decide Solomon has some divine wisdom going on, though it seems more like parlour tricks to my cynical eye.