A combination of both nature and nurture. A person can be born with certain traits and tendencies, such as a tendency to obedience or kindness or compassion or whatever (and their negative opposites, too), but education and experience have a lot to do with it.
I never cease to be amazed with my own (large) family; we all had the same home life and parents and educational opportunities, and yet we are so different. Many are rebellious, angry, negative and selfish while a few are compassionate, kind and considerate of others.
I think most virtues such as temperance have to be taught. As for things such as innocence, which a person can be by default (e.g. a child), shouldn't be considered virtues though they are normally considered to be by others.
"Virtue" is a completely socially constructed reality... so, definitelty: taught! "Right" and "wrong", in my personal lexicon, can be sensed/ self-determined... but 'virtuous' behavior is simply that behavior condoned or idolized by a given individual's society (and therefore an unambitious goal, the attainment of which is mere caving to peer pressure)... woman scared to speak her opinion: virtuously demure! religious bigot bent on annihilation of other faiths: virtuously devout! nationalist zealot determined to wage war on (whatever country has something we want/ whoever they've cast as OTHER): virtuously patriotic!!!
Bullshit, I say... 'virtue', historically, is 'whatever individual traits that most benefit those currently in power.'
'Innocence' is not a virtue, it's a stage; after a certain point, it becomes willful ignorance. Following a specific religious group's views about *anything* can get people to call you virtuous, even given pretty much any behavior you can think of... There's a difference, in my eyes, to 'right' and 'virtuous': and the difference is in who decides it-- me or others... and *either way*, it is a learned behavior. I learned from my parents that thinking for myself is a positive thing, and the path to a definition of 'right' that means anything; I have relatives that learned adherence to a strict (other-determined) code of conduct as the One And Only Path to Virtuous And Right Behavior... but either way it's learned: either you value your own best judgement, or what someone else says is the best way for you to act/ the best values for you to hold...
In my own internal world, I'd WAY rather do the right thing (ie be true to my own sense of fair play and reasonable behavior) than to put my (tofu)eggs in the basket of perceived 'virtue''... If someone says you're being 'virtuous,' check your pocketbook and your underpants: somehow or other, odds are good you're getting screwed.