Mental Illness runs in families. There is always a possibility to inherit behavioural symptoms or endphenotypes. That is to say, that there are measurable components in science that look at neurophysiological, biochemical, neuroanatomical, cognitive or neuropsychological structure in the brain.
This genetic code analysis can refer to anything from the size and shape of brain cells, to changes in brain structure, or to impairments in working memory. The term endophenotype can refer to a physical trait or a functional one.
So, we can be born with a pre disposition to mental illness. But it doesn't mean a person could suffer all the time, only that during times of crisis and without guidance & cognitive retraining, one could experience fleeting episodes. You see, Doctors diagnose a psychiatric disorder based on patient's symptoms. They test for complex psychiatric traits like vivid hallucinations, manic episodes and bizarre delusions. This sort of thing - does't happen all the time.
In Psychiatry, the theory is that genes and environment combine. So can Mental health issues be genetically inherited and be learned? Nature and Nurture? The short answer is yes, because mental health is just a state of mind. read: Mental Health, what is it really?.
P.S. I'd like to add, that I think there are two types of mental health episodes a person can experience when suffering mental unwellness. The first one is often a coping mechanism when faced with moments of crisis and is usually a poor & underdeveloped behavioural response. This kind of behaviour can be worked with, through therapy.
The second type is psychosis when the person does not even realize they are exhibiting questionable behaviour. This is when medication and appropriate care giving is needed. These are all just diagnoses and one can recover. That's what George Herman House's philosophy is all about. Recovery.