With his father who was an official in Beijing, Ban Gu was able to study in Luoyang Imperial College. In the introduction of imperial academy and Ban Biao, he read widely and studied the words of a hundred schools of thought, which laid a solid foundation for writing Hanshu in the future. Ban Gu does not stick to one pattern in his research, "not for chapters and sentences, but for righteousness", and studies various schools with an open mind. Because of his modesty and generosity, Ban Gu is deeply loved by bachelors.
In the 30th year of Jianwu (54 years), Ban Biao died, and Ban Gu returned to his hometown from imperial academy to mourn his father. In his anxiety, he began to sort out his father's historical records? After the biography. In the process of sorting out, he found that the history described in Houzhuan was not detailed enough, so he decided to complete the revision work on behalf of his father and write Hanshu on the basis of Houzhuan. Unfortunately, shortly after this work began, someone wrote to Ming Di Xianzong, saying that he had tampered with the national history without permission. Ban Gu was arrested and put in Jingzhao prison. All manuscripts were copied and sent to Luoyang. At this time, thanks to his brother Ban Chao wrote to Ming Di to defend him; The county magistrate also wrote a letter for him, and Ban Gu was released from prison. His talent was discovered by Ming Di, and he was immediately transferred to the school book department, and was named "History of Lantai" to compile national history. When he and Chen Zong and others finished the Biography of Ancestors, he was promoted to Lang Guan and served as the secretary of Canon Studies. Since then, Ban Gu has spent more than 20 years of hard work, and basically completed the compilation of Hanshu by the middle of Zhang.
Since Ban Gu moved to Langguan, he has been highly valued by the emperor. When Emperor Zhang was in power, Ban Gu saw that the capital was under construction, so he went to the "two capitals" and was appreciated by Emperor Zhang. Since then, he has been favored by the emperor more and more. Ban Gu was repeatedly called into the palace by Emperor Zhang. When Emperor Zhang went on patrol, Ban Gu accompanied him from time to time. Whenever there is an important event in the imperial court, Ban Biao will be introduced, and Ban Gu will be ordered to express his opinions and debate with ministers or ministers. In fact, he became the personal attendant and consultant of Emperor Zhang.
In the third year of Zhang Di's founding (78), Ban Gu was promoted to Xuanwu Sima. In the second year, Emperor Zhang, imitating the story of the Western Han Emperor Shiqu Pavilion, convened a famous contemporary Confucian scholar in Baihuguan to discuss the similarities and differences of the Five Classics and ruled by himself. As a historian, Ban Gu took part in the minutes of the meeting and was ordered to organize the results of the discussion into "The White Tiger with the Same Theory" (also known as "White Tiger Yi Tong").
In the first year of Yongyuan (89), He Di ascended the throne. General Dou Xian made an expedition to Xiongnu, and Ban Gu was appointed as the guard of the China Guards to participate in the discussion. Dou Xian was defeated by Khan and climbed Mount Yanran (now Hang 'ai Mountain in Inner Mongolia Autonomous Region). Ban Gu wrote a famous inscription on Mount Yanran and carved stones to record his achievements. Ben and Dou are family friends. After Ban Gu entered the shogunate in Douxian, the relationship between them became closer. In the 4th year of Yongyuan (92), Dou Xian moved troops back to Chaoxian. Soon he committed suicide because of the failure of political struggle. Ban Gu was removed from office. Due to the feud with Ban Gu, Luoyang Ling took the opportunity to accuse Luo Zhi and arrested Ban Gu. In the same year, Ban Gu died in prison at the age of 6 1.