President Donald Trump has vowed to go to the US Supreme Court as election result hangs in the balance.