TALLAHASSEE — Closing the book on a legal fight that drew national attention, the state and attorneys for a group of parents, educators and students reached a settlement in a battle over a 2022 law that restricts instruction about gender identity and sexual orientation in schools.