As the New Testament opens we find that Jesus is the culmination of an 1800 year genealogy from Abraham via David and the exile. It's remarkable that this has happened and is traceable.
The Bible is a relentless search for The Seed (Gen 3:15) and so genealogies are mines in which to search for the gold of the gospel.... in which to search for The Christ.
What's The Law got to do with all of this? God made a promise and then 430 years later gave The Law. Later additions don't cancel or modifying the terms of a promise so why give the law?
For 430 years Abraham's family have been a family, a small family in Canaan who grew to a large nation contained in Goshen... and then they were set free as a vast nation with an inherited sinful desire for the gods of other nations with whom they began to intermarry.
The Law locked Israel down and ensures that a distinctive and identifiable remnant is preserved despite their best efforts to vanish into the nations and the pursuit of their gods. Much of Israel disappeared into nations (the Northern tribes) - but Judah (with Benjamin and Levi) survived. Imagine what would have been left without the restraining influence of the law...?
Thanks to The Law, 1800 years after Abraham, the promised Seed could come from a people carrying the grammar of the gospel (particularly around the Temple) "so that" (Galatians 3:22) Jesus can be identified as the long expected Christ.
The Law helps us to see his life, death, resurrection, ascension and the pouring out of the Christing Spirit and know that Jesus is the Christ. Moses knew, and Jesus would preach himself from The Law to make his disciples hearts burn as they heard of The Seed, The Tabernacle... of Jesus leading his people out of slavery, of his meeting with his people, of the way that the air Israel breathed was meant to preserve her identity, and should have made her long for the Christ, and die to self-righteousness and sinning and everything (Gal 2:19). It put the nation death and in the end it put Jesus to death too...
Galatians 3 demonstrates the scope-limited, time-limited, purpose-limited but necessary role of the law for Israel, to bring the Christ - for all the nations. Not a complete theology of The Law, but a vital one, that served the gospel and has now completed it's purpose. The Law remains as Scripture from which all nations in Christ can benefit as they step into the promise made to Abraham concerning his offspring 'The Christ' in whom peoples from all the nations can become Sons of God.
Thank God for The Law given to Israel that ensured that the Christ came for the nations!