This is a favorite verse of those who seek to show the Bible full of errors. There is no prophecy in the Old Testament that in anyway connects The Messiah to the city of Nazareth; neither was Messiah a Nazarene, John the Baptist was. So what, might you ask, is going on here?
First, the book of Matthew was original written in Hebrew and the earliest translator either didn’t understand what Matthew meant or he wanted to enhance the word play.
In Hebrew the word Natzar means branch. So this is a Hebrew pun, they are in fact not that unusual in the Old Testament as Hebrew lends itself to to lot of word play. See Also: Paronomasia/Word Play in the Bible
The city name of Nazareth or in Hebrew, Natzrat is derived from the Hebrew word for branch and was where the main road branched off into two roads one to the coast and one inland.
Secondly the Old Testament is full of word plays using people and city names because they almost always have meaning. i.e. Mic 1:10-16 is a section of word plays on the names of cities of Judah, such as that of Bethleaphrah, meaning “the house of dust”. In this section the city is told to roll themselves in the dust.
“There shall come forth a shoot from the stump of Jesse, and a branch shall grow out of his roots. And the Spirit of the LORD shall rest upon him, the spirit of wisdom and understanding, the spirit of counsel and might, the spirit of knowledge and the fear of the LORD. And his delight shall be in the fear of the LORD. He shall not judge by what his eyes see, or decide by what his ears hear; Is. 11:4 but with righteousness he shall judge the poor, and decide with equity for the meek of the earth; and he shall smite the earth with the rod of his mouth, and with the breath of his lips he shall slay the wicked. Righteousness shall be the girdle of his waist, and faithfulness the girdle of his loins.” Is. 11:1-5
“but you are cast out, away from your sepulcher, like a loathed untimely birth, clothed with the slain, those pierced by the sword, who go down to the stones of the Pit, like a dead body trodden under foot.” Is. 14:19
“Your people shall all be righteous; they shall possess the land for ever, the shoot of my planting, the work of my hands, that I might be glorified.” Is. 60:21
“In those times a branch from her roots shall arise in his place; he shall come against the army and enter the fortress of the king of the north, and he shall deal with them and shall prevail.” Dan. 11:7