That's up to the user.
There's nothing requiring that a user be anonymous; in fact, many people use their real names and photos because SO is well-known enough that having rep here can help you get a job.
So if the user wants to be associated with whatever it is, then that's their decision. If they don't, then there are a couple options.
If there's sensitive information in a post, the first step is to edit it out. Then flag for moderator attention - they'll be able to redact the information from the revision history.
If they just don't want the entire post attached to their name, then they can request to be disassociated from the post - the post will not show them as the author. You can do this by either using "contact us" or a moderator flag.
And, of course, you can always edit your own username and avatar if that's what you want.