He hailed from Zou 鄒 (modern Zoucheng 鄒城, Shandong) and was known as a very decent person whose only desire was to learn. He therefore studied the Confucian Classics Shijing 詩經, Shangshu 尚書 and the ritual books and was given the name "great Confucian of Zou and Lu" (Zou-Lu daru 鄒魯大儒).
During the reign of Emperor Zhao 漢昭帝 (r. 87-74 BCE) he was appointed erudite (boshi 博士) and palace attendant (shizhong 侍中), which allowed him to enter the palace as a teacher to the Emperor. He later rose to the offices of Grand Master of Splendid Happiness (guanglu dafu 光陸大夫) and Chamberlain for Dependencies (da honglu 大鴻臚). Emperor Xuan 漢宣帝 (r. 74-49 BCE) transferred him to the post of Chamberlain for the revenues (shaofu 少府) of the Changxin Palace 長信宮, and he was given the title of Marquis within the passes (guanneihou 關內侯).