The former Greens MP has quit parliament in the wake of an affair with a staffer that breached Greens Party rules.