Where it is
Do not do unto others what thou wouldst not have done to thee. It appears in the Analects when a student, Zigong, asks for a single word to live by, and again inside a longer answer to another student. Zigong produces it himself, unprompted, in a third passage, and is told it is beyond him.
The one thread
The complication is a famous scene. Confucius says there is one single thread binding his way together, says so to a student by name, and leaves the room. The others turn on the young man and ask what he meant, and the answer they get, faithfulness and fellow-feeling, is the student's, not the Master's.
It has been the received answer for two and a half thousand years, and it is a gloss.
The doubt
The golden-rule passages do not behave like the teaching around them. The rest of the book is worked through particular men in particular difficulties. These few passages state a portable principle. One specialist treats them as later insertions on those grounds. Most scholars do not go that far.
There is a broader caution. The word at the centre of his teaching, ren, is generally held not to reduce to a rule at all: caring for others, from an understanding of how things look where they are standing, shown in conduct rather than defined in sentences.