Mamdani, the democratic socialist who catapulted to national attention during the race for New York City Mayor, took the oath of office at an historic, decommissioned subway station in Manhattan.