A federal judge has approved a settlement of a sex-discrimination suit against State Farm Insurance Co.