Cognitive dissidence is a general term for mental conflicts in belief, but I don’t think it’s exactly what you’re looking for for two reasons. Firstly, as long as it doesn’t bother you it’s not cognitive dissidence. Secondly, cognitive dissidence applies to many contexts that aren’t what you’ve described in the question.
The term that describes precisely the belief in two contradictory things is doublethink. Doublethink comes from the book Nineteen Eighty-Four, a dystopian novel by George Orwell. The Wikipedia article for doublethink reads
Doublethink is the act of simultaneously accepting two mutually contradictory beliefs as correct, often in distinct social contexts.
the novel explicitly shows people learning doublethink and newspeak due to peer pressure and a desire to "fit in", or gain status within the Party—to be seen as a loyal Party Member.