Just what is the legitimate sphere of government? Let's look at a few examples:
You go on vacation, driving on an interstate highway built under government direction.
The fire department responds to your neighbor's house fire.
Burglars would break into your cousin's apartment, except the police caught them during a previous crime and they are now in jail.
A foreign tyrant looks enviously at Alaskan oil, but leaves it alone when he sees the ability of our military.
Your nephew lives downstream from a factory that might pollute the river if it were not for the laws against that pollution.
Those represent legitimate functions of government. They provide what economists call external costs and benefits, or externalities. Externalities are defined as costs or benefits accruing to someone not directly involved in the transaction. Your cousin is not involved in the burglars' “business” but he would pay if government didn't enforce the law. As citizens we are not involved in the tyrant's “business,” but we lose if government fails to defend the country. Individually, you paid next to nothing to build that freeway, but many people travel on it. Those are all externalities. Externalities and nothing else are the properly the domain of government.
However that does not mean that government should automatically meddle with all external costs and benefits. It should determine if a proposed action is really worth doing, fair, and worth the cost. For example, it should not build the new road that primarily benefits the mayor's cousin, nor should it build a fancy stadium that brings minimal benefit to the people. Government should also avoid actions that unduly restrict freedom, even if those actions fall within the sphere of external benefits. Some would claim that government should do things like dictate the colors houses should be painted. Free men, however, would object on the grounds that people should make their own choices in such matters, not force their idea of beauty on others. We should remain free unless there are strong and compelling reasons to impose a restriction.