Extreme heat affects our memory and cognitive ability. Studies show that it is also linked to a rise in mental illness.