Hiding a person's identity is sometimes done when a journalist wants to shield a source from harm. (This is not the same as an anonymous source.)
If you protect someone's privacy by using a fictional name for a real person, you must say so in your story. You must say so very close to the beginning of the story, not at the end! You must also explain why.
If you don't, then how can the readers trust you?
For example, a young woman living far away from her family is dating a man of a different religion. In her family, this is a serious offense, and she does not want them to find out. For a long feature story about religious differences, you interview the woman and her boyfriend in great detail. You know the story will appear on your newspaper's Web site, and chances are that someone from her family might read it. So you assure the woman that you will disguise her identity.
This probably requires more than not using her real name. If her family lives anywhere other than a huge city, you cannot name their town. If she has a somewhat unusual job, you should not be specific about her job title. Consider all the details that might give her away, and keep those details OUT of your story.
Don't play around with someone else's life. When you guarantee your source some kind of protection, you must make sure you follow through.