Observation of inversion, hysteresis, and collapse of spin in optically trapped polariton condensates