God’s law did not originate with the Law of Moses. Law was first introduced when God said, “from the tree of the knowledge of good and evil you shall not eat.” So, law was there in the Garden—just not “the Law” as it was later given. And sin was also around from the very beginning. But sin could not be charged unless law existed to identify it (Romans 3:20). The pursuit of righteousness through obedience to law is what Paul called the “elementary principles of the world” (Colossians 2:8).
Man has an inbred penchant for attempting to justify himself in this way. It’s absolutely fundamental to our thinking about God. And why shouldn’t it be? It just seems so right! But making people work for righteousness was never God’s intent for law. Even in the Old Testament, obeying God was meant to be an act of faith, not merely an attempt to accumulate enough points to somehow satisfy Him.