Lewis Hamilton has been crowned the 2017 Formula One world champion, despite finishing ninth in what proved to be a bizarre Mexico Grand Prix.