While sleeping, your brain is hard at work performing some very critical functions necessary to keep it operating at optimal levels.