Wearing a dark suit and red tie and accompanied by his wife, Melania, in a powder-blue suit and matching gloves, Mr. Trump took the 35-word oath administered by Chief Justice John G. Roberts Jr. precisely at noon.