US president Barack Obama has implored Americans to elect Hillary Clinton to the White House, casting her as a candidate who believes in the optimism that powers the nation's democracy and warning against the "deeply pessimistic vision" of Republican Donald Trump.