it gets hard to explain because it gets confused with dissociative identity disorder a lot, which you do not seem to have, because for that you would have to need chronic amnesia about days months and years in your life to happen as a major factor.
what you describe is in some sense a milder version of it. like every healthy personality is consisting of many, many aspects of personality. like you can be a housewife and at the same time a sensitive woman, at the same time you have a job that takes different requirements on you, and so on. also every person has something called the "inner child", as in the person you were as a child.
people that experienced trauma in childhood usually have dissociated the aspects of personality which is what you describe. it's also called traumatized identity, of course it's worse when the trauma is occuring in childhood because the identity hasnt even developed fully.
People with a consistent personality are aware that they take different roles e.g. at work and at home. A person with dissociative identity disorder would switch between those states and then only remember being at home, not remembering the prior hours at all. A person with traumatized identity can be confused about who they really are, they can suffer from depersonalisation where they feel strange about how they handle situations and such, but they do always remember. Simply put together thats the difference.
I have that too. My father was very authoritarian and verbally, physically and emotionally abusive. When authority figures are strict with me or other people take up an authoritarian tone, I immediately and automatically switch to being very obedient. It's especially weird since beside that reaction Im rebellious and predominant and such.
you can read a little about traumatizide identity here:http://childhoodtraumarecovery.com/2013/05/17/childhood-trauma-identity-problems-and-how-to-tackle-them/
If possible you can look for professional counselling in sense of psychotherapy.