According to the preamble of the United States Constitution, the five aims of government are to form a more perfect union, establish justice, ensure domestic tranquility, provide for the common defense and promote the general welfare. There is actually a sixth function of government outlined by the Constitution that asserts the government will secure the blessings of liberty to its citizens and future generations.
One of the first functions of government is to form a more perfect union, meaning that the government will treat all states in the union fairly and work to keep the union together. Another function of the government is to establish justice by protecting those that follow the laws of the country and by punishing those that do not. The government also functions to ensure domestic tranquility. This function is meant to task the government with ensuring that its citizens can enjoy a calm, happy life "in a godlike and dignified manner." The fourth function of the government is to provide for the common defense, making sure that all life in the country is defended from warring nations or domestic threats. The government must also provide for the common welfare of the nation, ensuring that all citizens are given the opportunity to have productive lives with an acceptable standard of living. There is also a sixth function outlined in the preamble, where the government must defend the ideas of liberty for all who live in and will be born in the U.S. in future generations.
There can be many different functions of government besides the conventional idea that governments should defend the country, the citizens, liberty and property.