Writing may have been invented at least three times in history:
1. Sumerian writing in Mesopotamia around 3200 BC
2. Chinese writing along the Yellow River before 1200 BC
3. Mesoamerican writing in Guatemala and Southern Mexico a little after 500 BC (ch. 8, p. 14)
All quotes from (Linguistics for Students of Asian and African Languages.