Law is a set of rules, norms, institutions and community commitments that enables people to secure their rights and freedoms. It is a source of scholarly inquiry in many disciplines, including legal history, philosophy, economic analysis and sociology. It also raises complex questions about equality, fairness and justice.

The term law can refer to a wide range of legal systems, but a common feature is a hierarchy of authoritative statements. Judges, barristers and other members of the judiciary act as agents of law by making decisions and interpreting laws. Lawyers advise clients on how to navigate the legal system, and they write drafts of contracts, wills, pleadings and other documents that make up the fabric of law.

Law also applies to the activities of public authorities, such as police, fire and rescue services and government agencies. These activities are regulated by law and governed by a code of ethics. Other public authority roles include regulating the use of natural resources and protecting citizens from pollution. In addition, law addresses the relationship between a state and its citizens and regulates financial markets.

The foundations of law are found in ancient legal traditions, such as Roman law, which was compiled in a series of codes during the reign of Theodosius II and Justinian I. These codes were subsequently replaced by custom and case law. In the medieval world, royal courts produced a body of precedent that is now known as common law.

A major function of law is to provide compensation to individuals who have been harmed by the actions of others. This area of the law is called tort law and covers issues such as negligence, trespass and defamation. Criminal law concerns offenses against the community, such as murder and fraud, and is regulated by the government.

Despite the importance of law in society, it remains a relatively obscure subject. This is partly due to the fact that it has some unusual features that distinguish it from other areas of knowledge, such as a normative (prescriptive) rather than descriptive nature and a lack of means for verifying its accuracy compared with empirical science (e.g. the law of gravity) and social science (e.g. the law of supply and demand in economics).

Another factor is that it is difficult to teach. A good approach to learning law begins with a broad understanding of its scope and focuses on the most significant aspects. It then becomes possible to examine specific topics in detail and understand how they fit into the larger picture. Finally, it is essential to develop a strong analytical and logical mind in order to comprehend the reasoning that underpins the law and its interpretation. This can only be achieved by reading and studying a wide variety of texts, both historical and current. This can be a very time-consuming process, but it is vital for the development of a sound understanding of the law. Law is therefore a complex and fascinating subject, which provides a rich source of material for research in many different disciplines.