I need to understand Noah's history. It says in Genesis 6:9 that Noah was a just man; that he walked with God. But what does it mean by "just?" I mean, there wasn't a law at the time, Moses didn't exist.
The same about Cain killing Abel. God told him to do good when God saw how his face changed. So, it was God telling him "do better than this and you won't have a reason to be angry"?
God often talks about good and evil in Genesis, but He didn't give a law to follow. How did people know what was good and what was evil?
I John 3:4 says that sin is the transgression of the law. How could Cain have sinned if there wasn't a law? And Jacob, he deceived his father, but Israel came from him and not from Esau.
I'm guessing the answer is in "Now man has become like Us, knowing good and evil." Which means, they could tell what was good and evil naturally, even though they didn't have a law for it.
But I'd still ask for your help.
You've stumbled onto questions that Paul addressed in Romans. Paul charged all men with sin, but "the law brings about wrath; for where there is no law there is no transgression" (Romans 4:15). So, if there really was no law before Moses, then men could not be charged with sin. It would not be fair or just of God to charge people with not keeping what they did not know about.
However, we know that people did sin prior to Moses. "For until the law sin was in the world, but sin is not imputed when there is no law. Nevertheless death reigned from Adam to Moses, even over those who had not sinned according to the likeness of the transgression of Adam, who is a type of Him who was to come" (Romans 5:13-14). Paul reasoned that because the consequence of sin existed (death) prior to Moses, then sin must have been present. Since sin was present, then there had to have been law.
We call the period before Moses the Patriarchal Age. This was the time when God dealt directly with the heads of families (the patriarchs). Like God's warning to Cain (Genesis 4:6-7), we can assume that people were taught the difference between right and wrong.
But Paul takes this further. Even though most of the world did not have a written law, people did understand moral choices. "For when Gentiles, who do not have the law, by nature do the things in the law, these, although not having the law, are a law to themselves, who show the work of the law written in their hearts, their conscience also bearing witness, and between themselves their thoughts accusing or else excusing them" (Romans 2:14-15). No matter where you go in the world, most people understand that you don't murder another human being, most people understand that you don't take another person's things without permission, you don't sleep with another man's wife, etc. For example, notice how Pharaoh scolded Abram, "And Pharaoh called Abram and said, 'What is this you have done to me? Why did you not tell me that she was your wife? Why did you say, 'She is my sister'? I might have taken her as my wife. Now therefore, here is your wife; take her and go your way'" (Genesis 12:18-19). While all the fine details are not present, still people, without a written law, know instinctively about things found in God's law. God was just to hold them accountable for the things they could have known. Even with the more generous provisions, all men still sinned. Thus we conclude that law always existed.
Where did that instinctive knowledge of right and wrong come from? I think you are correct in pointing to the Tree of the Knowledge of Good and Evil. That instinct doesn't function immediately, but at some point in our development, it comes into play. That is why God did not hold the children guilty of their parent's sin. "Moreover your little ones and your children, who you say will be victims, who today have no knowledge of good and evil, they shall go in there; to them I will give it, and they shall possess it" (Deuteronomy 1:39). I find this particular passage interesting because the same phrase in Hebrew is used to describe both the Tree of the Knowledge of Good and Evil and the innocence of children.