Have personality traits evolved to help the human species survive?
I have a friend who is doing her PHD in psychology. She is doing it on "Where do personality traits originate from? " ( A bit to open ended for my likely but ehh). It got me thinking, is the reason that we have different personality traits because we need them as a species to survive, Quick example - in a forest there are berries we do not know if they are poisonous. Different personality traits would make different decisions:
1) - we don't eat them - survive or go hungry and die
2) - we do eat them - death or possible new source of food
I am kind of extrapolating on the idea of why we are different genetically - we are different so one virus doesnt wipe us out (i know there a few reasons we are different but this is one). So is this why we have different personality traits, so one situation does wipe us out?
That kind of explains nature of humans but what about the idea of nurture?
the way i would explain this is, In different time we need different type of people; in war we need soldiers or in times of plague we need healers so is this why people can be changed through nurture?
I don't know if this is an already held idea as my primary field is mathematics and not biology. If this is true could you give me a way to research this idea further (Book, references, topic names), if not then what idea supercedes this one?