Spin-density-functional calculations of tip-suspended gold chains, with molecular oxygen, or dissociated oxygen atoms, incorporated in them, reveal structural transitions for varying lengths. The nanowires exhibit enhanced strength for both oxygen incorporation modes, and upon stretching tip atoms join the wire. With incorporated molecular oxygen the wire conductance is about 1(2e2/h), transforming to an insulating state beyond a critical length. The nanowire conductance with embedded oxygen atoms is low, 0.2 (2e2/h), and it develops magnetic moments localized on the oxygens and the neighboring Au atoms.