Air China (CA) does not fly to SFO-TPE, but China Airlines (CI) and EVA does (BR)
For ex-SFO, your choice should be SFO --> TPE then travel to Tao Yuen High Speed Rail Station and jump on the train. It makes no sense to back track to the Domestic Airport for your Tainan feeder flight.
Shuttle for Airport to Train Station
http://www.taoyuanairport.gov.tw/eng...ighspeed_e.jsp
High Speed Train Information
http://www.thsrc.com.tw/en/index.asp
If ex-CAN / ex-SZX (or ex-HKG ? ), try find a flight to KHH / TPE / TSA and then connect via high speed train. KHH is closer but has less flight
For TSA you travel on Taipei Metro to Taipei Rail Station, then High Speed Train. (Note : TSA has no regular flight to TNN)
For KHH you need to travel on Kao Hsiung Subway to Zuoying Station then head on highspeed.