TikTok is gearing up for a legal fight against a U.S. law that would force the social media platform to break ties with its China-based parent company, a move almost certainly backed by Chinese authorities as the bitter U.S.-China rivalry threatens the future of a wildly popular way for young people in America to connect online.