what is the function of school in society