I used to think like this till about 21 years of age. It's difficult to accept that you are wrong. But sometimes, you just have to say, I am wrong! Hit bottom with feeling flawed (and not "perfect") does wonders in terms of shifting your mindset.
Often the inflated ego is associated with fear...