How old is the usage of the word 上帝？ The word 上帝 is associated by many with western religions. My question is, is there any occurrence of this word in ancient chinese writings or inscriptions?
Sure. The sequence「上帝」can be seen in Shang Dynasty oracle bone inscriptions, e.g. 《甲骨文合集》10166:



Here are some other samples in oracle bone inscriptions.

「上帝」originally meant highest ruler「帝」residing in heaven「上」(above). Other than this meaning,「上帝」doesn't bear much resemblance to the Christian's God, having nothing to do with universe creation or morality.