This is figurative. It's talking about God and Israel being related as a husband and wife, and how in such a comparison, Israel was a nasty whore the whole time--this referring to idolotry.
Interestingly, God revisits this simile when he instructs Hosea to go find a whore and marry her as a symbol of what he did for Israel.