Cui Riyong was born in 673, during the reign of Emperor Gaozong. His family was from Hua Prefecture 滑州 (roughly modern Anyang, Henan), but was The third house of Boling of the prominent Cui clan of Boling 博陵 (in modern Hengshui, Hebei), which became prominent during Northern Wei. Cui Riyong's branch featured officials who served during Northern Wei, Northern Qi, and Sui Dynasty. Cui Riyong's great-grandfather Cui Shili 崔世立 served as a minister in the imperial government during Sui and carried the title of Viscount of Anping, although his grandfather Cui Kang 崔抗 and father Cui Yi 崔漪 both only served as local officials.
Cui Riyong passed the imperial examinations and was made the sheriff of Ruicheng County. In 701, during the reign of Emperor Gaozong's wife Wu Zetian, she was traveling from then-capital Luoyang to the western capital Chang'an, and went through Shan Prefecture 陝州 (roughly modern Sanmenxia, Henan), which Ruicheng belonged to, and at that time, the former chancellor Zong Chuke, a son of a cousin of Wu Zetian, was prefect. Cui was responsible for the supply of the imperial attendants, and he collected many delicacies and offered them to the imperial attendants in Zong's name. When Zong heard about this, he was greatly pleased and recommended Cui. Cui was therefore made the sheriff of Xinfeng County 新豐 (in modern Xi'an, Shaanxi) -- considered a promotion, since Xinfeng was part of Yong Prefecture 雍州, which Chang'an belonged to. Soon thereafter, he was made an imperial censor.
Early in the second reign of Emperor Gaozong's and Wu Zetian's son Emperor Zhongzong (705-710), the sorcerer Zheng Pusi 鄭普思, whose daughter was a concubine of Emperor Zhongzong's, was suspected of planning treason. As Zheng Pusi was favored by Emperor Zhongzong, Emperor Zhongzong initially ordered the investigations to halt, and it was said that it was Cui Riyong's insistence that further investigation was carried out, eventually leading to Zheng Pusi's exile. At that time, a court faction was forming around Emperor Zhongzong's powerful wife Empress Wei, including her lover Wu Sansi (Wu Zetian's nephew) the Prince of Dejing, Zong Chuke, and Wu Yanxiu (武延秀). It was said that Cui was a member of this faction as well, and was a result was promoted to be deputy minister of defense (兵部侍郎, Bingbu Shilang) and made an imperial scholar at Institute for the Refinement of Letters (xiuwen guan 修文館). (It was said that he received the imperial scholar status only after making the request after a dance at an imperial feast.)
In 710, Emperor Zhongzong died suddenly—a death traditional historians believed to be a poisoning carried out by Empress Wei and her daughter Li Guo'er the Princess Anle, so that Empress Wei could become "emperor" like Wu Zetian and Li Guo'er could become crown princess. For the time being, Emperor Zhongzong's son by a concubine, Li Chongmao the Prince of Wen, was named emperor (as Emperor Shang), but Empress Wei retained power as empress dowager and regent. Her party viewed Emperor Zhongzong's brother Li Dan the Prince of Dan and sister Princess Taiping as threats and considered eliminating them. Cui Riyong, who was aware of this situation, was fearful that if the plot to eliminate Li Dan and Princess Taiping backfired, he would be incriminated along with the rest of Empress Dowager Wei's party, and therefore, through the Buddhist monk Purun 普潤 and the Taoist monk Wang Ye 王瞱, arranged a meeting with Li Dan's son Li Longji the Prince of Linzi. At the meeting, he informed Li Longji of the situation. Li Longji and Princess Taiping quickly responded, starting a coup and killing Empress Dowager Wei and Li Guo'er. In the aftermaths of the coup, Cui was made acting secretary general of Yong Prefecture (which was the capital prefecture by this point, as Emperor Zhongzong moved the capital from Luoyang back to Chang'an) and charged with leading a group of imperial guards to the block where Empress Dowager Wei's clan lived and slaughtering it—and as the block was shared with the Du clan, it was said that Cui killed a number of the Du clan members as well. Li Dan, a former emperor himself, returned to the throne (as Emperor Ruizong), displacing Emperor Shang. Cui was given the honorific title Yinqing Guanglu Daifu 銀青光祿大夫 and made Huangmen Shilang 黃門侍郎, the deputy head of the examination bureau of government (門下省, Menxia Sheng). He was also given the designation Canzhi Jiwu 參知機務, making him a chancellor de facto, and created the Duke of Qi.
After about a month as chancellor, he began to develop a rivalry with fellow chancellor Xue Ji, and he repeatedly argued with Xue before Emperor Ruizong—with him accusing Xue of flattering Wu Zetian's lover Zhang Yizhi and Zong, and Xue accusing him of flattering Wu Sansi. Emperor Ruizong, tired of their bickering, removed both of them from their chancellor posts, with Cui becoming the prefect of Wu Prefecture 婺州, roughly modern Jinhua, Zhejiang). He later successively served as the prefect of Yang 揚 (roughly modern Yangzhou, Jiangsu), Bian 汴州 (roughly modern Kaifeng, Henan), and Yan 兗州 (roughly modern Jining, Shandong) Prefectures.
As of 713—by which time Emperor Ruizong had yielded the throne to Li Longji, who took the throne as Emperor Xuanzong, but Emperor Ruizong was still retaining power as Taishang Huang (retired emperor) -- Cui Riyong was serving as the secretary general of Jing Prefecture 荊州 (roughly modern Jingzhou, Hubei). At that time, Emperor Xuanzong and Princess Taiping were locked into a power struggle, and when Cui happened to be in Chang'an on official business on one occasion, he suggested to Emperor Xuanzong that he suppress Princess Taiping's party. Emperor Xuanzong, who received similar advice from Wang Ju (王琚) and Zhang Shuo, agreed, and as part of the preparation, made Cui the secretary general of Yong Prefecture. It was further said that Princess Taiping, Dou Huaizhen, Cen Xi, Xiao Zhizhong, Cui Shi, Xue Ji; along with other officials Li Jin 李晉 the Prince of Xinxing (a grandson of Li Deliang (李德良), a cousin of Tang's founder Emperor Gaozu), Li You (李猷), Jia Yingfu (賈膺福), Tang Jun (唐晙); the generals Chang Yuankai (常元楷), Li Ci (李慈), and Li Qin (李欽); and the monk Huifan (惠範), were plotting to overthrow Emperor Xuanzong. It was further said that they discussed, with the lady in waiting Lady Yuan to poison the gastrodia elata that Emperor Xuanzong routinely took as an aphrodisiac. When this alleged plot was reported to Emperor Xuanzong by Wei Zhigu, Emperor Xuanzong acted. He convened a meeting with his brothers Li Fan (李範) the Prince of Qi, Li Ye (李業) the Prince of Xue, Guo Yuanzhen, along with a number of his associates — the general Wang Maozhong (王毛仲), the officials Jiang Jiao (姜皎) and Li Lingwen (李令問), his brother-in-law Wang Shouyi (王守一), the eunuch Gao Lishi, and the military officer Li Shoude (李守德) — and decided to act first. On July 29, Emperor Xuanzong had Wang Maozhong take 300 soldiers to the imperial guard camp to behead Chang and Li Ci. Then, Jia, Li You, Xiao, and Cen were arrested and executed as well. Dou and Princess Taiping committed suicide. Emperor Ruizong yielded powers to Emperor Xuanzong and no longer actively participated in policy decisions thereafter. For his participation, Cui was made the minister of civil service affairs (吏部尚書, Libu Shangshu), but was rebuffed in his attempts to return to chancellorship. On one occasion, at Emperor Xuanzong's birthday, he offered Emperor Xuanzong a collection of poems from the Mao Edition of the Shi Jing, as well as the text of the declaration Sima Xiangru wrote for Emperor Wu of Han when Emperor Wu was set to offer sacrifices to heaven and earth at Mount Tai. In doing so, Cui was said to be trying to correct Emperor Xuanzong's behavior, and Emperor Xuanzong, appreciating the offering, issued an edict thanking him and awarding him with a robe and silk.
Later, on the account of a brother or cousin's being punished, Cui Riyong was demoted out of the capital to serve as the prefect of Chang Prefecture (常州, roughly modern Changzhou, Jiangsu), and his fief was reduced. He later served as the prefect of Ru Prefecture (汝州, roughly modern Pingdingshan, Henan). In 719, Emperor Xuanzong issued an edict recognizing Cui for his contributions and partially restoring his fief. In 722, he was made the secretary general at Bing Prefecture (并州, roughly modern Taiyuan, Shanxi), and soon died there.
It was said that Cui spoke well and was dexterous in his reactions. Whenever events were about to occur at court, he would react in such a way that he avoided disaster and retained his status. It was said that he often said:
Throughout my life, I have acted in response to the situation, not with advance planning. Whenever I think back to those events, I would feel terrified at the threats posed me, just like if there were thorns on my back.