In the previous section, Zechariah had predicted future outpourings of the Holy Spirit in which repentance and cleansing would be experienced by those who were convicted by the Spirit. How would those people show the change in their outlook? The prophet goes on to explain what would happen.
The prophet says that the Lord will remove the influence of idolatry and false prophecy from their hearts. In order to show the deep level of repentance the prophet says that even parents would pierce their son if he was a false prophet (v. 3). Another illustration he uses is of a false prophet who is discovered attempting to hide but whose secret is discovered because of the marks in his hands (cutting oneself was a feature of false worship).
The false prophets in Zechariah's day may not have been connected to another religion. Instead they could have claimed that they were spokesmen of the true God. But it would become obvious that they were liars when their predictions did not happen.
This passage reminds us that a fruit of repentance is a love for God's truth. Those who have truly repented will turn from all substitutes and instead listen to the truthful explanation of the Bible and will develop an ongoing understanding of it. Of course, when that practice occurs, it will reveal further reasons for repenting, and so the wonderful experience goes on.