Writing systems were independently invented no fewer than three times (Mesopotamian, Chinese, and Mayan are unquestionably independent inventions) and probably more times, while also being reinvented from scratch numerous times after that (Cherokee being perhaps the most well-documented such reinvention--Sequoyah knew of writing from the Americans, but had no other conception of how it worked, and his documentation of the process of developing the Cherokee syllabry is a nice compression of the history of stages of writing systems). It does not seem to be a particularly challenging invention.
There appear to be two key hurdles that are required for the development of writing. The first is the creation of a systematic inventory of stylized representations of objects, for example knowing that this symbol represents "sun" and that one represents "eye". In particular, I'd draw the "systematic" inventory here as the challenge--merely representing concepts in visual drawings seems to be a pretty universal capability. The second hurdle is the re-encoding of (some of) these symbols to represent phonetic values in an abstract way. (Note that being able to represent any phonetic utterance of a language is the distinguishing characteristic between proto-writing and writing.)
If you actually want to know how language is created, well, there is a recent community of deaf people who spontaneously invented their own sign language de novo, which suggests that language is actually incredibly easy to invent.
…
"Note that being able to represent any phonetic utterance of a language is the distinguishing characteristic between proto-writing and writing."
Huh... does Chinese meet that criteria? https://en.wikipedia.org/wiki/Logogram#Differences_in_proces...
Strangely, many, perhaps most users of it think it is not a syllabary. This is largely because it is what they were told as children, and it makes little difference in use, within bounds of Mandarin.
People who speak other Chinese languages, which Mandarin speakers are taught to think of as dialects (i.e. basically the same as Mandarin but for variant pronunciation), know better. It is common among Mandarin speakers to believe they can read texts in these other "dialects", not realizing that what they read has been translated to Mandarin. (Writing "in dialect" is done very rarely, except for transcribed loan words, because it is not taught; the elaborate spelling rules for Mandarin would not work, as is.)
The CCP encourages this misapprehension.
I guess that counts.