It seems that British people say "I brought the book for her" and "I brought the book to her" interchangeably. British people might think the 2 sentences are almost the same except that "for her" emphasizes the purpose and "to her" emphasizes the action.
I am not sure American people say "I brought the book for her" because I don't see "for sb" in American dictionaries.
I say "I brought the book for her" is confusing because you did something for somebody when that person asks you to do so or we do it for that person's benefit.
For example, I cooked dinner for her.
So, now, "I brought the book for her" could mean "I brought the book to the man for her" which means she asked me to bring the book to another person.
for her
is roughly equivalent to sayingfor her sake
, whileto her
is roughly equivalent to sayingtoward her
(orin her direction
).