Most linguists believe that writing was invented in China during the latter half of the 2nd millenium BC and that there is no evidence to suggest the transmission of writing from elsewhere. The earliest recognisable examples of written Chinese date from 1500-950 BC (Shang dynasty) and were inscribed on ox scapulae and turtle shells - "oracle bones".
In 1899 a scholar from Beijing named Wang Yirong noticed symbols that looked like writing on some "dragon bones" which he had been prescribed by a pharmacy. At that time "dragon bones" were often used in Chinese medicine and were usually animal fossils. Many more "oracle bones" were found in the ruins of the Shang capital near Anyang in the north of Henan province.
The script on these "oracle bones" is known as ¼隆脕¹ÇÎÄ (jiăgŭw隆搂¦n) - literally "shell bone writing". They were used for divination, a process which involved heating them then inspecting the resulting cracks to determine to answers to one"s questions. The bones were then inscribed with details of the questions and the answers. Most of the questions involved hunting, warfare, the weather and the selection of auspicious days for ceremonies.
Further information about the oracle bones:
A collection of oracle bones in the National Palace Museum near Taipei.
Recently archaeologists in China have unearthed many fragments of neolithic pottery, the oldest of which date from about 4800 BC, inscribed with symbols which could be a form of writing. None of these symbols resemble any of the Shang characters and the likelyhood of deciphering them is remote given the paucity of material.