Scholars generally assume that the first form of writing developed in Mesopotamia over 5,500 years ago (present-day Iraq). Early visual signs were progressively replaced by a sophisticated system of letters representing Sumerian (the language of Sumer in Southern Mesopotamia) and other languages' sounds. These early writings are called "cuneiform" after the impression made by the rounded ends of the cylinders used to make them.
The first written documents that have survived are clay tablets inscribed with symbols indicating what we now call Sumerian cuneiform writing. They were used as accounting records by merchants working in the cities of Uruk and Lagash around 4500 B.C. These tablets are also the earliest evidence we have for organized religion. The people who wrote these records may have been priests or officials charged with maintaining the city's pantheon of gods.
Writing was probably not invented to replace speech. It evolved as an additional means of communication, usually alongside speech. One reason it became so popular is that it can store information that would be difficult or impossible to communicate verbally alone. For example, someone might write down instructions for building something complicated like a machine gun or spacecraft. They could then give the document to others who could follow the instructions easily and correctly without being able to build the device themselves.
Writing also has many other uses beyond storing information and communicating ideas.
Sumerian archaic (pre-cuneiform) writing and Egyptian hieroglyphs are often regarded as the oldest real writing systems, evolving from their parent proto-literate sign systems about 3400–3100 BCE, with the earliest coherent texts around 2600 BCE. However, some have argued that certain markings on rocks and minerals may be evidence of earlier writing systems. For example, some have suggested that markings found in Brazil that are similar to those used by Egyptians to write their language were made as early as 1450 BCE.
However, these claims remain controversial and open to debate. It is generally accepted that Chinese characters developed from a script known as Jiaozhi Ci, which was invented around 500 BCE. The original form of Chinese character is called "oracle bone script" because it was used to record spells for use in divination during the Shang dynasty (1600–1046 BCE). Some scholars believe that the script was derived from an even older form of writing, but this remains unproven.
The Phoenicians are credited with inventing alphabetic writing, but this is also disputed. Some claim that the ancient Egyptians learned the art of writing from the Phoenicians, but there is no conclusive proof of this relationship.
In conclusion, all true writing systems can be traced back to three early systems: Sumerian, Egyptian, and Phoenician.
The first known writing system is Sumerian cuneiform. Its roots may be traced back to around 8,000 BC, when it evolved from pictographs and other symbols used on clay tablets to indicate trade products and cattle. It was also used as a record-keeping tool by the ancient Sumerians.
Other civilizations have been suggested, including Egypt and China, but these claims are largely based on stylistic similarities between their own scripts and the early examples of Sumerian cuneiform. No actual written documents have ever been found that can be conclusively assigned to any of these proposed systems.
Even though modern scholars believe that Sumerian cuneiform was followed by several other writing systems in the region (such as Elamite and Akkadian), it was not until much later that writing spread beyond Mesopotamia. The earliest known example of an independent writing system is found in India around 3300 BC. It was called "Carnatic poetry" because most of its practitioners were members of the royal family of the southern state of Carnatic. This poetry was usually composed in the Tamil language and often included references to local flora and fauna along with political commentary, so it was also used as a means for rulers to communicate orders and laws. However, unlike modern writings which are done on paper using ink, the early Indian poets used haircloth as their medium.