(Galatians 3:23-29 ESV) Now before faith came, we were held captive under the law, imprisoned until the coming faith would be revealed.  So then, the law was our guardian until Christ came, in order that we might be justified by faith.  But now that faith has come, we are no longer under a guardian,  for in Christ Jesus you are all sons of God, through faith.  For as many of you as were baptized into Christ have put on Christ.  There is neither Jew nor Greek, there is neither slave nor free, there is no male and female, for you are all one in Christ Jesus.  And if you are Christ's, then you are Abraham's offspring, heirs according to promise.
Part 1: Verse 23 - Held Captive.Before faith came Israel was held captive under the law. The faith referred to is Jesus and the New Covenant. The Mosaic Covenant was made with the physical nation of Israel that was delivered from Egypt and them alone. They were captive and imprisoned under the law provisions of the Mosaic Covenant UNTIL the coming faith. While the Mosaic covenant had a gracious purpose and provision for God’s mercy, the Jews were under law and had an obligation to obey it or be cursed. Once Jesus Christ came and fulfilled the Mosaic Covenant on the cross of Calvary, the Mosaic Covenant ended and the New Covenant began. That is why Paul said in Romans 6:14, “you are not under law but under grace.”