Continuity mistake: When Hal's co-workers bring him a cake for his promotion, Rosemary takes a slice out for herself. They change shots a couple times, and the size of the piece missing from the cake changes several times, and the layers of the cake change as well.
Continuity mistake: In the scene where Hal is confronting the two guys that made fun of Rosie he points to Rosie outside the restaurant and her shoes change from brown and black clogs (which is what she was wearing throughout the scene) to a plain black slide. Watch, it is totally obvious because they show her shoes several times before they suddenly change.
Continuity mistake: After Rosemary cuts the cake, she lays the knife down and in the next few shots the knife changes position from laying down to sitting up back to laying down again.
Answer: I think he was in the movie to reinforce that she is a genuinely nice person and that she had a wide circle of friends who appreciated her.