Taipei is the capital city and seat of government of the Republic of China.
Taipei is the political center from which the Republic of China (ROC) government operates on Taiwan. The ROC was founded in mainland China in 1912, but after the Chinese Civil War its government relocated to Taiwan in 1949. Taipei then became the nation’s seat of government and remains the location of the Presidential Office, Executive Yuan, and other central institutions.
The city lies in a basin in northern Taiwan, near the meeting of the Tamsui River and its tributaries. It developed from a trading settlement into Taiwan’s major administrative, cultural, and economic center. In 1967, Taipei was upgraded to a special municipality with a status directly under the central government.
This question involves a political naming issue. The Republic of China and the People’s Republic of China are different governments with competing claims over Taiwan and China, so references to “China” can be confusing. In the context of the Republic of China government, Taipei is the canonical answer. Beijing is the capital of the People’s Republic of China, while Shanghai is its largest city and Hong Kong is a special administrative region.