Okay, so, I'd be more than happy to go into analyzing Gilgamesh on a deeper level than a fun shitpost that is for fun, but I can tell you right now that no, the Epic of Gilgamesh was not written down to inform people about the underworld or what things were like before the flood
We're talking about a hero that is part of a larger mythology and was surrounded by a robust, thriving oral tradition. People absolutely didn't need written records to "remember" basic things about their worldview.
Especially not about the underworld or the pre-flood world, because the epic barely describes those things. I don't think all versions even have the part with the path of the sun (this may be because our tablets are fragmented). The flood narrative is often commented upon even by scholars as awkwardly shoehorned into a storyline that isn't very relevant to it (i would argue that it is thematically relevant, because of the idea of the gods as supreme in their powers over human life, but that's neither here nor there). This is just not what the story is ABOUT.
Gilgamesh was, to some extent, a real historical figure, and the focus of the epic is on human mortality. Gilgamesh is immortal in human memory because his story was written down; it's a form of memorialization, just like steles commemorating great victories or the majestic walls of Uruk.