While there is no shortage today of anti-dispensationalism in the church of Jesus Christ--with some preachers and teachers averring that Dispensationalism is false teaching, there is still something to be said for the legitimacy of its theology.
Though not a rabid dispensationalist myself, in my opinion the teaching regarding Dispensationalism's "Age of Conscience" can go a long way to answering your question about the existence and role of the Law of God prior to Mosaic law.
From Compelling Truth:
Dispensationalism is a system of theology that organizes history into
different periods, or "dispensations," of how God works. It is a way
of looking at God's plan for specific periods in history to roll out
the revelation of Himself and His desire for relationship with people.
Of the classic seven dispensations, or ages, the dispensation of
conscience (Genesis 3:23 to 8:19) is second after the dispensation of
innocence (Genesis 1:27—3:19) in which God interacted with the first
humans face to face.
Each dispensation is said to have a six-part pattern. For the
dispensation of conscience, the pattern is:
Managers: Cain, Seth, and their families Time Period: Expulsion from
the garden of Eden until the Flood, about 1,656 years Human
Responsibility: Do good and offer blood sacrifices (Genesis 3:7, 22;
4:4) Failure: Wickedness (Genesis 6:5–6, 11, 12) Judgment: Worldwide
Flood (Genesis 6:7, 13; 7:11–14) Grace: Noah and his family are saved
(Genesis 6:8-9; 7:1; 8:1)
The end of the first dispensation, that of innocence, came about when
Adam and Eve disobeyed God. God then instituted conscience as a way
humans could delineate between good and evil, choose good, and have a
relationship with God through blood sacrifice (Genesis 4:4). Almost
immediately, people chose evil. Cain killed Abel (Abel was the first
person ever to die) because God accepted Abel's animal (blood)
sacrifice but did not accept Cain's grain sacrifice. Cain had a
choice, clearly communicated by God (Genesis 4:6–7), to choose good in
obedience. Cain refused, expecting God to fall in line with his own
ideas of how to have a relationship with Him.
Mankind did not fare well, violating . . . conscience and failing to do
what was right. Evidently God wanted to demonstrate to mankind that
conscience cannot be our only guide. During the dispensation of
conscience, only three people were declared righteous—Abel, Enoch, and
Noah (Hebrews 11:2–7; Genesis 5:22–24; 6:8–9). Before the Flood, "The
LORD saw that the wickedness of man was great in the earth, and that
every intention of the thoughts of his heart was only evil
continually" (Genesis 6:5).
Because Noah was righteous, God chose him to warn others as he built
the ark for 120 years (Genesis 6:14–22; 2 Peter 2:5). None heeded. God
righteously judged the sin of people and they suffered the
consequences of their choices—but the human race also experienced
God's mercy. God spared Noah and his family (Genesis 7:1; 8:1; Hebrews
11:7), showing how He could and would "rescue the godly" (2 Peter
2:4–10). A new dispensation began (that of government)]1 (my emphasis).
A close reading of Genesis 4 serves to illuminate the ways in which human conscience is informed by God's "thou shalt nots" and God's "thou shalts," even before God codified those do's and dont's in the Law of Moses.
Those ways would have to include the role and effects of parental instruction on children, particularly the inculcation of values via each parent's sound teaching and consistent role modeling. We can only speculate about the nitty gritty of how this process functioned in the first millennium of human history. We can, however, mine for clues in the biblical narrative.
First, Adam and Eve undoubtedly taught their first two sons about the singular role that God should play in their lives, both ethically and morally. Not only were the eyes of their parents opened to the existence of both good and evil (a Hebrew merism), but every child born to the human race after the Fall has an innate sense of right and wrong, good and evil.
Notice what God said to Cain after God did not look with favor upon his offering:
"If you do what is right, will you not be accepted? But if you do not
do what is right, sin is crouching at your door; it desires to have
you, but you must rule over it” (Genesis 4:7 NIV).
"Do what is right," God told Cain. That takes care of the "do's" in the Age of Conscience. On the other hand, "If you do not do what is right, sin is crouching at your door" takes care of the "don'ts" in the Age of Conscience.
Whether or not Cain's parents ever told him about the time that God clothed them with skins of animals is an unknown. It stands to reason, however, that Abel somehow knew of the importance of offering up to God an animal whose blood was shed. Cain, too, likely knew of the significance of an animal sacrifice but chose instead to offer up to God "the fruits of the soil."
Abel was in no way superior to Cain, just because he kept flocks. Neither was Cain superior to Abel because he was a farmer. A legitimate assumption is that they both were taught by their parents the value of work and honest labor. Again, one of those "oughts" that comes with having been created in the image of God.
Another indication of the presence of innate laws within the breast of every image bearer is Cain's recognition that he deserved punishment for having killed his brother. Yes, he protested the severity of God's punishment, but graciously the LORD marked Cain, and with that mark, people who saw it would know he was off limits. Even though he committed murder, God would not allow anyone to murder him. To God and to His image bearers, the murdering of a human being has been and will always be wrong.
One indication the Age of Conscience was temporary and clearly not workable is the reaction of Lamech, the first bigamist, after having "killed a man for wounding. . . [him],and a young man [i.e., likely a young warrior]
for injuring . . . [him] (4:23]. From the NET Bible:
Lamech seems to reason this way: If Cain, a murderer, is to be avenged
seven times (see v. 15), then how much more one who has been unjustly
wronged! Lamech misses the point of God’s merciful treatment of Cain.
God was not establishing a principle of justice when he warned he
would avenge Cain’s murder. In fact he was trying to limit the
shedding of blood, something Lamech wants to multiply instead. The use
of “seventy-seven,” a multiple of seven, is hyperbolic, emphasizing
the extreme severity of the vengeance envisioned by Lamech.
The generations of humanity that preceded God's giving of the Law to the children of Israel were not without an inner witness about the rightness and wrongness of behavior. That inner witness, or conscience, was far from perfect, to be sure, and as observed by the writer of Compelling Truth, the Age of Conscience produced only three people whom God declared righteous: Abel, Enoch, and Noah.
True enough, God did something in the early days of humanity that He does not seem to do today: Occasionally He spoke to His image bearers, encouraging them to do the right thing. However, that so many people violated their consciences, and humankind--with the exception of Noah and his family--became so sinful that God had to destroy them and save a mere eight, meant that when God started over with only eight souls, He would need to usher in a new dispensation, the Dispensation of Human Government. After that came the Dispensation of Law.
In conclusion, humankind has never been without the inner witness of conscience, even though conscience is clearly fallible. Nor has humankind ever been without some sort of human government, no matter how primitive it may have been. And where would Western Civilization be without its common law heritage? Conscience, government, and law--each has its place, but each one is at best imperfect. What is greater than all of them is the reign and rule of Jesus in the hearts of his image bearers.