Arabic is in the Semitic language group, which seems to have gotten started before the beginning of writing, somewhere near modern Syria, and to have spread from there through Lebanon, Israel, and Jordan down to the Arabian peninsula. Because the Arabian peninsula was more isolated, people there continued to speak an older version of the language, while in Israel and Syria Semitic languages mixed more with Indo-European and other language groups.
Until the time of Mohammed, in the 600s AD, Arabic was mainly spoken and not written. Still, there are some written records from the Arabian peninsula from before the 600s AD. These are called Sabataean. But they are only short inscriptions in stone, not literature.
The alphabet first came to the Arabian peninsula and was used to write Arabic not too much before 400 AD; it's descended, like all the other alphabets, from the first alphabet invented in the Levant.
After the Islamic conquests of the late 600s AD, people soon began to speak Arabic all over the Islamic Empire, from Afghanistan to Spain. By 1000 AD, some people knew Arabic even in India and East Africa.
Many people began to write in Arabic. Among the first things they wrote was the Quran, but soon many scientific texts and medical books and math books were written in Arabic, and also stories like the Arabian Nights or the Shahnameh. Arabic writers retold older stories from other places: the Greek story of Odysseus and the Cyclops finds its way into the story of Sinbad the Sailor, and the Indian Jataka Tales were retold as Nasruddin stories. There were many Arab historians, geographers, philosophers, and poets. But in the eastern part of the Islamic Empire, many people still spoke and wrote in Persian (an Indo-European language). One famous Persian story, written about 1000 AD, is the story of Sohrab and Rustem.
Here's a song by Yusuf Islam (who used to be
Cat Stevens) to teach the Arabic alphabet:
As Turkic and Altaic people from Central Asia moved into West Asia, beginning in the later medieval period, many people also told or wrote stories in Turkish. You can compare stories about the trickster Nasruddin to African Anansi stories.