Interesting. I looked this up and there's a Wikipedia page listing the earliest written accounts [0]. Looks like joint earliest are Egyptian hieroglyphs in the tomb of Seth-Peribsen [1] and ancient Sumerian tablets [2]-[3]. It seems like a lot of early writing was also concerned with religion although a lot of the slightly later writing did cover economic and administrative records.
These seem to define writing to mean only things with which you can write sentences, which is fair enough, but excludes earlier use of symbols for counting (of taxes!). I have in mind things like [1], or this from [2]:
"The original Sumerian writing system derives from a system of clay tokens used to represent commodities. By the end of the 4th millennium BC, this had evolved into a method of keeping accounts, using a round-shaped stylus impressed into soft clay at different angles for recording numbers. This was gradually augmented with pictographic writing by using a sharp stylus to indicate what was being counted. Round-stylus and sharp-stylus writing were gradually replaced around 2700–2500 BC by writing using a wedge-shaped stylus (hence the term cuneiform), at first only for logograms, but developed to include phonetic elements by the 29th century BC. About 2600 BC, cuneiform began to represent syllables of the Sumerian language."
Ah, yes I failed to pick up on that distinction in your last post. Now I almost want to add "sophisticated trade system" to the list of written language prerequisites.
"The original Sumerian writing system derives from a system of clay tokens used to represent commodities. By the end of the 4th millennium BC, this had evolved into a method of keeping accounts, using a round-shaped stylus impressed into soft clay at different angles for recording numbers. This was gradually augmented with pictographic writing by using a sharp stylus to indicate what was being counted. Round-stylus and sharp-stylus writing were gradually replaced around 2700–2500 BC by writing using a wedge-shaped stylus (hence the term cuneiform), at first only for logograms, but developed to include phonetic elements by the 29th century BC. About 2600 BC, cuneiform began to represent syllables of the Sumerian language."
[1] https://en.wikipedia.org/wiki/History_of_ancient_numeral_sys...
[2] https://en.wikipedia.org/wiki/History_of_writing#Proto-writi...