Somalis did not use an indigenous writing system directly before the inventions of Osmanya, Kaddare, and Borama which were invented in the 1920s-50s. Instead, we used the Arabic alphabet to write with. Long ago, our ancestors used an ancient script found that has yet to be deciphered. Below some of the drawings in the famous prehistoric cave paintings of Laas Gaal is an ancient Stone Age writing system that has also not been deciphered. So our ancient history is not documented by us, although we did pass on some knowledge of our ancient history, much of it has been lost in the memories of the Somalis. Therefore, I will provide some basic information on the ancient history of Somalis derived from the documentation of non-Somalis.
According to ancient Egyptian, Greek, Arabic, and other sources, Somalia is home to ancient, sophisticated civilizations. Here are some names that our civilizations and city-states were known as to others before the arrival of Islam although I am most likely leaving out a few pre-Islamic city-states or kingdoms:
Land of Punt (ancient kingdom), Macrobia (ancient kingdom), Bilad al-Barbar/Land of Berbers as we were known by Arabs (used to refer to our ancient kingdom), Opone (ancient city-state), Malao (ancient city-state), Avalites (ancient city-state) Essina (ancient city-state), Sarapion (ancient city-state), Damo (ancient city-state), Mosylon (ancient city-state), Mundus (ancient city-state), and Tabae (ancient city-state).
The above city-states are described or referred to in the "Periplus of the Erythraean Sea" which is an ancient Greek document written around 1 AD by someone with first-hand knowledge of the areas around the Indian Ocean.
Many remnants still in existence today attest to our long history such as ancient aqueducts, factories, citadels, stone walls, pyramidal structures, stone walls, ruined cities, cairns (known by us as taalo), harbours, courtyards, pottery from ancient Egypt and Rome and other regions, among other structures and artifacts. For example, the Wargaade Wall is an ancient stone wall that once surrounded an old city. It is within this area that graves and pottery are found that are well over 1000 years old.
Somalia has had a very long and prosperous maritime history and enjoyed lucrative trades with the ancient Egyptians, Greeks, Persians, Indians, Chinese, Arabs, among others since, by the estimation of non-Somali scholars, at least 2nd millennium BC.
Herodotus is a Greek historian who live for some years during 400 BC. He wrote about the kingdom of Macrobia which existed during and before 500 BC. They were known as the "tallest and handsomest of all men". Here is one story he wrote about the Macrobians:
"Herodotus narrates, that, when Cambyses [an ancient Persian emperor] sent ambassadors to the Macrobians, they asked what the Persians had to eat and how long they commonly lived. He was told that they sometimes attained the age of eighty, and that they ate a mass of crushed grain, which they termed bread. On this, they said that it was no wonder, if the Persians died young, when they partook of such rubbish, and that probably they would not survive even so long, but for the wine they drank; while the Macrobians lived on flesh and milk, and survived one hundred and twenty years."
Their kingdom was an early centre for embalming as their knowledge of anatomy and some chemistry led to their practise of embalming. This knowledge could have been inherited by the ancient Egyptians who are renown for their mummification practises. This possibility is further strengthened by the ancient Egyptians' own attestation of being the descendants of the Land of Punt.
In the 2nd to 3rd millennium BC, Somalis domesticated the camel which then spread through Africa and other regions. So the first camel herders were Somalis.
"Upon conquering Ancient Egypt, the Persian Emperor Cambyses II sent ambassadors to Macrobia, bringing luxury gifts for the Macrobian King to entice his submission. The Macrobian ruler, who was elected based at least in part on stature, replied instead with a challenge for his Persian counterpart in the form of an unstrung bow: if the Persians could manage to string it, they would have the right to invade his country; but until then, they should [be thankful] that the Macrobians never decided to invade their empire."
As for ancient beliefs, the Somalis believed in a single deity known as Waaq. Many Cushitic groups did and do believe in Waaq, such as the Oromo who believe Waaq to be a single deity. The word is believed to have derived from the ancient Somali word for sky-god. Another word Somalis used was Eebe (which means God) and was synonymous with Waaq as both referred to one ultimate deity. Barwaaqo (literally "God's rain") was what nomads called the rain that fell after having prayed to God for it. Today, Somalis use it as a word signifying blessings. For example "nabad iyo barwaaqo" is a common expression used when parting to expression good wishes. Ceel Waaq (literally "God's well") is a city on Somalia and Kenya's border. Caabud waaq is a city as well as a region in Somalia. In Egypt, there is a city called Kafr Al-Waq or Kafr El-Waq. Kafr means "village" so it could possibly mean "village of God" or "God's village". If there is another meaning for waq in Arabic, please let me know, but to the best of my knowledge, that is the meaning of the village. There is also a place called Al Waq in Yemen which could also be derived from this meaning.
According to our pre-Islamic beliefs:
"The equilibrium of the Universe in Somali mythology was tied with the love between a bull and a cow. The Universe was said to balance itself on the horns of a bull, a beast forever staring at the cow tied to a pole in front of him. Whenever his love turned her eyes away from the bull, it would result in a physical shift that caused natural disasters on Earth. Religious temples dating from antiquity known as Taalo were the centers where important ceremonies were held led by a Qallu priest."
This belief is shown in the numerous cave paintings in Somalia, most recognizably - Laas Gaal - some of which date back to 9000 BCE, that depict people bowing down to bulls adorned with ceremonial animal shells and decorative robes with large horns. Due to the antiquity of these paintings, it is safe to say that spiritual belief was a long-held and prevailing belief of Somalis before Islam.
Somalis also believed in Ayanle (angels), Huur (messenger of death), and Nidar (Punisher) who was the righter of wrongs. Some Somalis still say "Nidar ba ku heli" that exemplifies the old use of and beliefs about Nidar. Huur is known as Horus by the ancient Egyptians.
For more on the ancient beliefs of Somalis, visit this page:
http://somalifreethinkers.blogspot.ca/
I used Wikipedia, my own knowledge, Periplus of the Erythrean Sea, and other works as my sources. Please feel free to go into details, discuss, ask questions, or add your own information about our ancient history.