That happened to me in college.
Prior to that, I really didn't care what people thought of me (though I did feel lonely and didn't like that.) Basically, I felt like if someone couldn't like me the way I was, that person wasn't worth having as a friend.
In college, some people basically told me that I was off/wrong/not nice the way I was. I didn't want to be that way, and became very conscious of what I was doing and began second-guessing everything I said or did.
That has abated somewhat, but not completely. I still have trouble in new situations and with new people, being afraid that I am doing something to offend people. I still have trouble when people seem to decide they don't like me. I tend to question what I did wrong instead of assuming there's something wrong with the other person. I still make some social faux pas. They may be minor but still make me look odd. I am always afraid that a minor faux pas will cause a major problem with someone.
Basically, before college my question was "What is wrong with everyone?"
In college it was, "What is wrong with me?"
For most of my adult life, it has been a mixture of these two questions and not knowing where the line is between the two.