Ultimately, the best conclusion that can be reached is that the animals were marked clean and unclean for the purpose of bringing offerings to the Lord. The practice of bringing animals as offerings is first mentioned in Genesis 4, where Abel brought to the Lord of the firstlings of his flock and of their fat portions (Genesis 4:4).
Perhaps Noah knew which animals were clean because of knowledge passed down by Adam. Perhaps he knew of it through prophetic revelation from Enoch— or perhaps God had only recently revealed such information to Noah (in preparation for the next era of human history). Exactly how Noah came to learn which animals were clean and which were unclean can ultimately only be speculated upon. The purpose, however, for which Noah brought additional pairs of clean animals is known.
Noah would offer those animals as a burnt offering after the flood:
Noah built an altar to the LORD, and took of every clean animal and of every clean bird and offered burnt offerings on the altar (Genesis 8:20).In recognition of his sin and utter dependence upon God, Noah would lift up an offering to the Lord. For now, Noah had simply been instructed to bring additional clean animals on board the ark. Surely Noah must have (eventually, if not immediately) seen the purpose behind this! And how humbling of a purpose it was! God was making clear to Noah the high price for sin— that He is the one who saves— that man without God has no hope.
7 More Days - Genesis 7:4-5
The Time Comes to Enter the Ark (Part 1) - Genesis 7:1
State Of The World (2469 BC): 120 Years Before The Flood - Genesis 6:3
God's Covenant With Noah: Promised - Genesis 6:18
Summary of Genesis 6