China claims Taiwan to be a part of its sovereign territory. But that's bunk. A sovereign nation has a defined territory with a single government. But Taiwan and China are distinct territories each with its own government. Therefore Taiwan cannot be part of the sovereign state of China.
Furthermore, there is no reason to believe that the majority of the people of the sovereign nation of Taiwan wish to merge with China and become subordinate to the government in Beijing. That being the case, Taiwan is absolutely entitled to host anyone it wants on its territory, even including Nancy Pelosi, and even if she was wearing that hideous pink pajama suit. For China to threaten the sovereignty of Taiwan because an American politician has visited the island is preposterous.
It is equally preposterous for China to challenge the legitimacy of the Government of Taiwan. Rather it is the Government of Taiwan that has grounds to challenge the legitimacy of the Government of China. China's Communist government was established by insurrectionists in receipt of military aid from Joe Stalin's Soviet Union. The Communist insurgents led by the brutal dictator-to-be, Mao Tse Tung, expelled Chiang Kai -Shek's Nationalist Government from the Chinese mainland. The Nationalists were, however, able to retain a foothold on the formerly Chinese island of Taiwan. So if a question is to be raised about the legitimacy of government, it is clearly the Communist government of China that is illegitimate, and the Government of Taiwan that is the embodiment of a legitimate government of mainland China.
The American Government is right: China should keep its greedy hands off Taiwan. At the same time, China should also get its hands off both Tibet and Xinjiang, where it now pursues a vicious policy of ethnic cleansing. The former independent sovereign state of Tibet is the homeland of the Tibetan people, and Xinjiang is the homeland of the Uyghur people, a Turkic race, many of them blue-eyed and fair-haired, quite unrelated to the Han people of China.