"Being yourself" and living authentically is one of those goals that we champion, but can rarely explain why. We assume that it's good to always be consistent with "who you are", but there are some times where paying attention to those around you is much more important.
As Professor of Psychology Adam Grant explains, there's one key factor that determines how good or bad someone is at "being themselves". It's called self-monitoring. The more you self-monitor, the more likely you are to change your behaviour based on the people around you:
If you're a high self-monitor, you're constantly scanning your environment for social cues and adjusting accordingly. You hate social awkwardness and desperately want to avoid offending anyone...But if you're a low self-monitor, you're guided more by your inner states, regardless of your circumstances.
In some cases, this is great! If you're in a romantic relationship, you should probably be aware of your inner state and not constantly change who you are to suit whatever someone might want in that moment. While it sounds counterintuitive, paying attention to your own needs, traits and desires is extremely helpful in finding a partner you mesh with.
However, high self-monitors excel in other areas. For example, they're more likely to get promoted to leadership positions, because they're paying more attention to the people around them. They're quick to notice that someone else has a need and change their actions around that need. Where some might call this being a "phony" or kissing up to the boss, it's actually just noticing the needs of those around you and prioritising them. That can be a valuable career skill.