Groups characterized by their function