What do you do if your dating a girl and your friend keeps flirting with her?

Well, frankly I don't think your friend is good friend if he is trying to take your girl. Maybe you should find another friend who will respect you.