Public economics provides a framework for thinking about whether or not the government should participate in economic markets and to what extent it should do so. Microeconomic theory is utilized to assess whether the private market is likely to provide efficient outcomes in the absence of governmental interference; this study involves the analysis of government taxation and expenditures.
The role of government in providing efficient and equitable markets is largely underpinned by addressing market failures that may arise. Public Economics focuses on when and to what degree the government should intervene in the economy to address market failures.  Some examples of government intervention are providing pure public goods such as defence, regulating negative externalities such as pollution and addressing imperfect market conditions such as asymmetric information.
Pure public goods, or collective consumption goods, exhibit two properties; non-rivalry and non-excludability. Something is non-rivaled if one person's consumption of it does not deprive another person, (to a point) a firework display is non-rivaled - since one person watching a firework display does not prevent another person from doing so. Something is non-excludable if its use cannot be limited to a certain group of people. Again, since one cannot prevent people from viewing a firework display it is non-excludable. Another example, of a pure public good is knowledge. Consider a book. The book itself can be destroyed and thus is excludable. However, the knowledge obtained from the book is far more difficult to destroy and is non-rivalrous and non-excludable.  In reality, not all public goods can be classed as 'pure' and most display some degree of excludability and rivalrous. These are known as Impure public goods.
Due to the two unique properties that public goods exhibit, being non-rivalrous & non-excludable, it is unlikely that without intervention markets will produce the efficient amount. It therefore, the role of government to regulate the production of public goods so as to create an efficient market equilibrium.
Externalities arise when consumption by individuals or production by firms affect the utility or production function of other individuals or firms. Positive externalities are education, public health and others while examples of negative externalities are air pollution, noise pollution, non-vaccination and more.
Pigou describes as positive externalities, examples such as resources invested in private parks that improve the surrounding air, and scientific research from which discoveries of high practical utility often grow. Alternatively, he describes negative externalities, such as the factory that destroys a great part of the amenities of neighboring sites.
The role of government is to address the negative external effects and societal deadweight loss created from inefficient markets
Imperfect competition within markets can take many forms and will often depend on the barriers to entry, firms profit and production objectives and the nature of the product and respective market.  Imperfect competition will lead to a social cost and it is the role of government to minimize this cost. Some notable imperfection include:
Companies sell differentiated products
There are barriers to exit and entry
Suboptimal output and pricing
In its essence, the role of government is to address the issues that arise from these market failures and decide the optimal degree of intervention necessary. 
Diamond-Mirrlees efficiency theorem
In 1971, Peter A. Diamond and James A. Mirrlees published a seminal paper that showed that even when lump-sum taxation is not available, production efficiency is still desirable. This finding is known as the Diamond-Mirrlees efficiency theorem, and it is widely credited with having modernized Ramsey's analysis by considering the problem of income distribution with the problem of raising revenue. Joseph E. Stiglitz and Partha Dasgupta (1971) have criticized this theorem as not being robust on the grounds that production efficiency will not necessarily be desirable if certain tax instruments cannot be used.
One of the achievements for which the great English economist A.C. Pigou is known, was his work on the divergences between marginal private costs and marginal social costs (externalities). In his book, The Economics of Welfare (1932), Pigou describes how these divergences come about:
...one person A, in the course of rendering some service, for which payment is made, to a second person B, incidentally also renders services or disservices to other persons (not producers of like services), of such a sort that payment cannot be extracted from the benefited parties or compensation enforced on behalf of the injured parties (Pigou p. 183).
In particular, Pigou is known for his advocacy of what are known as corrective taxes, or Pigouvian taxes:
It is plain that divergences between private and social net product of the kinds we have so far been considering cannot, like divergences due to tenancy laws, be mitigated by a modification of the contractual relation between any two contracting parties, because the divergence arises out of a service or disservice to persons other than the contracting parties. It is, however, possible for the State, if it so chooses, to remove the divergence in any field by "extraordinary encouragements" or "extraordinary restraints" upon investments in that field. The most obvious forms which these encouragements and restraints may assume are, of course, those of bounties and taxes (Pigou p. 192).
Pigou suggested that the market failure of externalities can be overcome by the introduction of taxes. The government can intervene in the market, using an emission tax for example to create a more efficient outcome; this Pigouvian tax is the optimal policy prescription for any aggregate, negative externality.
While the origins of cost-benefit analysis can be traced back to Jules Dupuit's classic article "On the Measurement of the Utility of Public Works" (1844), much of the subsequent scholarly development occurred in the United States and arose from the challenges of water-resource development. In 1950, the U.S. Federal Interagency River Basin Committee's Subcommittee on Benefits and Costs published a report entitled, Proposed Practices for Economic Analysis of River Basin Projects (also known as the Green Book), which became noteworthy for bringing in the language of welfare economics. In 1958, Otto Eckstein published Water-Resource Development: The Economics of Project Evaluation, and Roland McKean published his Efficiency in Government Through Systems Analysis: With Emphasis on Water Resources Development. The latter book is also considered a classic in the field of operations research. In subsequent years, several other important works appeared: Jack Hirshleifer, James DeHaven, and Jerome W. Milliman published a volume entitled Water Supply: Economics, Technology, and Policy (1960); and a group of Harvard scholars including Robert Dorfman, Stephen Marglin, and others published Design of Water-Resource Systems: New Techniques for Relating Economic Objectives, Engineering Analysis, and Governmental Planning (1962).
^o Sharun W. Mukand, 2008. "policy reform, political economy of," The New Palgrave Dictionary of Economics 2nd Edition. Abstract. o James M. Buchanan, 2008. "public debt," The New Palgrave Dictionary of Economics 2nd Edition. Abstract. o Mrinal Datta-Chaudhuri, 1990. "Market Failure and Government Failure," Journal of Economic Perspectives, 4(3), pp. 25-39.. o Kenneth J. Arrow, 1969. "The Organization of Economic Activity: Issues Pertinent to the Choice of Market versus Non-market Allocations," in Analysis and Evaluation of Public Expenditures: The PPP System. Washington, D.C., Joint Economic Committee of Congress. PDF reprint as pp. 1-16 (press +). o Joseph E. Stiglitz, 2009. "Regulation and Failure," in David Moss and John Cisternino (eds.), New Perspectives on Regulation, ch. 1, pp. 11-23.Archived February 14, 2010, at the Wayback Machine Cambridge: The Tobin Project.
^Gilbert E. Metcalf, 2008. "tax incidence," The New Palgrave Dictionary of Economics, 2nd Edition. Abstract.
^Louis Kaplow, 2008. "optimal taxation," The New Palgrave Dictionary of Economics, 2nd Edition. Abstract.
^JEL: H51 - Government Expenditures and Health JEL: H52 - Government Expenditures and Education JEL: H53 - Government Expenditures and Welfare Programs JEL: H54 - Infrastructures; Other Public Investment and Capital Stock JEL: H55 - Social security and Public Pensions JEL: H56 - National Security and War JEL: H57 - Procurement
^JEL: H71 - State and Local Taxation, Subsidies, and Revenue JEL: H72 - State and Local Budget and Expenditures JEL: H73 - Interjurisdictional Differentials and Their Effects JEL: H74 - State and Local Borrowing JEL: H75 - State and Local Government: Health; Education; Welfare; Public Pensions JEL: H76 - State and Local Government: Other Expenditure Categories JEL: H77 - Intergovernmental Relations; Federalism; Secession