L.R.
This is very, very typical at this age. Please don't make too big a deal of this with her or she may either get worse about it -- stubbornly doing it even more because she knows it pushes your buttons -- or she may have the opposite reaction and be confused and upset with herself because she believes she's done something wrong and upset mom.
It's not necessarily lack of confidence or any inborn tendency to be a "blind follower" as you call it. It's being four, and thinking her little buddies are just the most interesting things in her whole world, and wanting to please the buddies in that instant of time. Nothing more. It doesn't necessarily mean she's surrendering her personality to others. Since she is "creative" and "stubborn" (do you mean, she wants what SHE wants and isn't a follower?) at home, I would not worry about this right now.
The time to worry would be if she has a friend who's pushy and unkind and regularly excluding other kids, and your daughter mimics that behavior. THAT would be cause for concern, and then it would be time for two things -- a talk about how we treat others, and distraction for your daughter as you quietly shift her away from playing with that particular friend.
But what you describe here is nothing like that. It's a copycat phase that is very normal and not worth getting worked up over.