The function of the nervous system in fish is to assist with reflexes and activities such as spawning.