The history of writing traces the development of expressing language by letters or other marks and also the study and description of these developments.
In the history of how systems of representation of language through graphic means have evolved in different human civilizations, more complete writing systems were preceded by proto-writing, systems of ideographic or early mnemonic symbols. True writing, in which the content of a linguistic utterance is encoded so that another reader can reconstruct, with a fair degree of accuracy, the exact utterance written down is a later development. It is distinguished from proto-writing which typically avoids encoding grammatical words and affixes, making it more difficult or impossible to reconstruct the exact meaning intended by the writer unless a great deal of context is already known in advance. One of the earliest forms of written expression is cuneiform.
Writing numbers for the purpose of record keeping began long before the writing of language. See History of writing ancient numbers for how the writing of numbers began.
It is generally agreed that true writing of language (not only numbers) was independently conceived and developed in at least three ancient civilizations and possibly more. The three places where it is most certain that the concept of writing was both conceived and developed independently are in ancient China around 5,000 BC,Sumer (in Mesopotamia) around 3100 BC, and Mesoamerica by 300 BC. (several Mesoamerican scripts are known, the oldest being from the Olmec or Zapotec of Mexico), as no precursors have been found to either of these, in their respective regions.
Independent writing systems also arose in Egypt around 3100 BC but historians debate whether these writing systems were developed completely independently of Sumerian writing or whether either or both were inspired by Sumerian writing via a process of cultural diffusion. That is, it is possible that the concept of representing language using writing, though not necessarily the specifics of how such a system worked, was passed on by traders or merchants traveling between the two regions.