For example, literary translation was historically done on the side by multilingual literary writers; to some extent, it still is, since literary translation is not lucrative enough in itself for one to make a living doing only that (even Gabriel García Márquez's English translator had to have a separate day-job).
Therefore, I would assume that translation of other types of documents was also simply done as an ancillary task by bilinguals in a given profession (e.g., legal documents would be translated by lawyers or judges happening to know different languages, or medical texts would be translated by multilingual doctors, etc.).
Do we know if this is true? If so, when does translation emerge as its own profession rather than a side-activity of a given field?
Also, please know that I am talking about written translation, and not interpreting (i.e., spoken translation), so try to keep your answers focused mainly on written translation.
The evidence of the existence of translation is essentially as old as the evidence of the existence of written text. The Ebla tablets (from Ebla, in modern Syria) are dated around 2500 BCE, and include a set of bilingual word lists in Sumerian and "Eblaite". Translation and/or interpreting would have to be at least as old as that "dictionary". Being able give a date to the birth of translation as a profession is more complicated. We simply don't know much about the people who did the translation that we know existed in the ancient world. For example, the Hebrew religious texts were at one point translated into vernacular after the end of the Babylonian captivity, probably around the end of the sixth century BCE, but we know nothing about those who did the translation.
In the ancient world, translators were most often people who had been captured as slaves in their younger years, who then learned a second language in their captivity, and would be valuable for their linguistic ability to translate and/or interpret. As a typical example, Livius Andronicus was brought to Rome as a Greek slave in his teenage years, in the second quarter of the fourth century BCE (and later freed), and he is the earliest literary translator that we know of, as he translated Homer, Aeschylus, Sophocles and Euripides from Greek into Latin. But we don't know enough about him to be able to tell how much his work as a translator was a side-activity done together with his work as a teacher and a playwright.
Delisle, Woodsworth, Translators through History (2012) Is a good book on the topic of the history of translation and interpreting, but it has very limited information about the profession in the ancient world, mostly because there is not much information to start with. As I mentioned, we know that translation was made and that translators facilitated commerce and other kind of inter-cultural contacts, but we rarely have any information about the translators themselves.
The earliest known reference to translation as a profession comes from the Akkadian language of ancient Mesopotamia, in which the word targumannu referred to translators (probably working between the Sumerian and Akkadian languages) as early as the 23rd century BCE.
That same root is preserved in many ancient and modern Middle Eastern languages, including Arabic ("tarjumān"), Aramaic ("targemana"), Hittite ("tarkumm") Hebrew ("metargem") and Turkish ("tercüman") — and even in Greek ("dragoman").
While the exact duties of a targumannu are not entirely clear from Akkadian texts, many seem to have worked primarily on written documents, such as economic records and business correspondence — which account for the vast majority of ancient Mesopotamian texts that have come down to us. Some may also have worked "live" in court and business settings; but the number of bilingual texts from this period make it clear that many educated people spoke both Sumerian and Akkadian fluently.