Musically speaking, "If I Were A Boy" hardly varies at all from the verses to the chorus.
This lack of variation works because of Beyoncé's incredible singing. Beyoncé is not afraid to use a vocal technique called melisma. Melisma, a favorite of American Idol wannabes, is a technique in which a singer moves between several musical notes continuously while remaining on the same syllable. This video of Aretha Franklin's use of melisma contains some great examples. Singers like Knowles and Mariah Carey have been criticized for overusing the technique to the point that it detracts from the melodies, with one critic saying, "as judicious as [Beyoncé's] singing can be, the effect in sum is still like being hit in the head with a fist in a velvet glove." But it's largely a question of taste, and B puts melisma to good use in this song.
So, we're clear that Beyoncé gives a great performance. But in terms of melody and chords, the main feature in "If I Were A Boy" is repetition, not musical innovation.
To explain what's behind the repetition, we looked to Toby Gad, the co-writer with BC Jean. Gad, who co-wrote "Big Girls Don't Cry" with Fergie, is partially responsible for at least twelve other Billboard hits. It might be appropriate to think about "If I Were A Boy" as part of the commercial pantheon of what some people call "corporate pop," pop written by behind-the-scenes producers who steer the music towards what market research and musical trends say is a radio-friendly and successful sound. What comes of that is an emphasis on hooks and catchy progressions, both defining elements of this song. People remember the melodic hook of "If I Were A Boy" even if they hate the song because it is a great melody. Just like "Single Ladies (Put A Ring On It)," "If I Were A Boy" seems engineered to get stuck in your head. And once again, whether that's a good thing or a bad thing is a question of taste.