From his twenties onward, Confucius aspired to enter officialdom and fulfill his ambitions, so he paid close attention to major affairs under heaven. He frequently pondered various issues of governing a state and often expressed his insights. By the age of thirty, Confucius had gained some renown. In the twentieth year of Duke Zhao of Lu (522 BCE), Duke Jing of Qi visited the State of Lu and summoned Confucius to discuss the question of Duke Mu of Qin's hegemony. He posed a question to Confucius: "In the past, the territory of Qin was small and its location remote. How was Duke Mu of Qin able to dominate the feudal lords and become the leader of the alliance?" Confucius replied: "Although Qin's territory was small, its ambition was great; though its location was remote, it was skilled in employing worthy talents. Duke Mu of Qin had a keen eye for talent, promoting Bai Li Xi (a former prisoner of war and talented minister) from prison. Moreover, Duke Mu of Qin boldly entrusted this foreigner, who had been imprisoned, with governing the state of Qin. Looking at this matter alone, Duke Mu of Qin's breadth of vision and boldness would have been sufficient even to rule the entire realm."
In the 25th year of Duke Zhao of Lu (517 BCE), internal turmoil broke out in the State of Lu, prompting Confucius to leave Lu for the State of Qi. Upon arriving in Qi, Confucius met again with Duke Jing of Qi. This time, Duke Jing asked Confucius about governance—that is, how to properly rule his state. Confucius replied: "Let the ruler be a ruler, the minister a minister, the father a father, and the son a son." These eight words essentially encompass the requirements for the entire social ethical system. Simply put: only when a ruler acts like a ruler will ministers act like ministers; only when a father acts like a father will sons act like sons. Each must strictly adhere to their respective roles and boundaries, never overstepping or losing their proper place, so that the state can prosper. Confucius spoke thus because at that time, the political power of both Lu and Qi was in the hands of high ministers, with rulers not acting like rulers and ministers not acting like ministers.
The aging Duke Jing of Qi, acting solely from the desire to consolidate his own position, repeatedly praised Confucius's words, saying, "These words are extremely wonderful. If indeed a ruler is not a ruler, a minister not a minister, a father not a father, and a son not a son, I fear I would not even be able to eat my meals." However, these eight words were clearly just a grand blueprint and a beautiful goal—not even a governing outline—so how could they be implemented in reality? Duke Jing of Qi was evidently unsatisfied with this answer and again "asked Confucius about governance." This time, he hoped Confucius could provide him with specific methods for ruling the state. Confucius said, "Governance lies in frugality" (rulers should minimize expenditures as much as possible). At that time, Duke Jing of Qi lived a lavish and extravagant life; the superiors set an example for the inferiors, and a trend of pride, luxury, and indulgence prevailed among the ministers and high officials of Qi. The moral decay in the ethical relationships between ruler and minister, father and son, also led to power struggles and conflicts between the upper and lower classes. This is why Confucius spoke as he did. This proposal directly addressed the current situation in Qi and the measures were relatively practical and feasible. Duke Jing deeply agreed and felt that Confucius indeed possessed talent for governing the state. Duke Jing then conceived the idea of employing Confucius and even prepared to grant him the fields around Nixi. However, Yan Ying (the Prime Minister of Qi) dissuaded Duke Jing from giving Confucius an important post, arguing that Confucianism adhered to old systems, had cumbersome rituals, was out of step with the times, and was difficult to use in governing. At that time, the power of Qi was in the hands of the Grand Master Chen, so although Duke Jing admired Confucius's words, he could not employ him. Confucius and his disciples lived in Qi for about two years. During this time, Confucius discussed music with the Music Master (Grand Musician) of Qi. He listened to the ancient music named "Shao," which had been passed down from Emperor Shun, and learned to play and sing it with such concentration that for a long period he ate meat without noticing its taste.
Duke Jing of Qi said to Confucius, "I cannot treat you as the State of Lu treated Ji Pingzi (a powerful noble of Lu), making you a high minister, nor am I willing to make you a low minister. I can grant you a position between the Ji and Meng families." However, a few days later, high officials of Qi plotted to harm Confucius. Upon hearing this, Confucius sought help from Duke Jing of Qi, who said, "I am old now and can no longer employ you." Feeling endangered, Confucius hastily left Qi and returned to the State of Lu.
