what is the purpose of the legislative branch of government

to punish lawbreakers
to make sure that laws are carried out
to decide whether or not laws are following the constitution
to write and pass laws

The purpose of the legislative branch of government is to write and pass laws. Additionally, it is responsible for ensuring that laws are being carried out and to decide whether or not laws align with the constitution. While punishing lawbreakers may be a function of the judicial branch, the legislative branch primarily focuses on the creation and amendment of laws.