Like almost all human traits, giving and taking exist along a continuum. At the far left and negative end are the "Takers" and the extreme negative end of those, the "Grabbers." Yuck. Grabbers can be very ugly. At the right and positive end are the "Reciprocators," and at the most positive far end, the pure "Givers." Givers are a blessing to you, and people you should treasure and emulate.
I like to give generously, and I don't like to keep score, but on the other hand I don't like to be taken advantage of. Years ago I gave to some people who not only turned out to be takers and grabbers, but psychopaths. I didn't get angry at them, but boy did I feel foolish. In fact, for a while I didn't give to anyone unless I was sure of getting something in return. Even though I prevented people from taking advantage of me, I didn't like approaching life from a "quid pro quo" position.
I finally came upon a formula that works for me, and if you're someone who likes to give but also doesn't like to be taken advantage of, it might work for you.
I do my best to surround myself with givers, or at least reciprocators, and when I find them, I add them as people I intend to have a long-term, and in many cases lifelong, relationship with.
When I run into takers and grabbers at the negative end, I try to identify them as early as possible* and only give to them as part of a trade where I immediately ask for something in return. As I get older, my preference is to have as little to do with these types as possible, because if you're generous by nature, even if you stay on your toes, takers and grabbers will get the better of you, and you can come to resent that.
The far more interesting realization has been regarding the vast majority of people who are in the belly of the bell shape curve above. I refer to those people as "Receivers." They are people that you can do many things for, and even though they don't give or reciprocate spontaneously, they are not takers or grabbers. It's just that they don't spontaneously think to offer something back to you, unless you ask them to do something. They are not bad or greedy people. In most cases, they're just trying to survive. When you do ask them, they will willingly and often gladly oblige and then do that favor for you that you ask. So, rather than getting your feelings all hurt when they don't spontaneously offer you something in return, stop playing the martyr and just ask them.
* One of the best ways to identify "Takers" and "Grabbers" early, if your gut is sending you signals, is to immediately say to them after they pressure you to do something, "Oh, by the way, that reminds me of something you could do for me." If they show any signs of pushing back or even appearing perplexed, that is a good sign that you are dealing with a taker or a grabber.
A while back I did that with someone who was a "dyed in the wool" taker and grabber. After I asked him for a favor, and he looked almost offended, I said to him: "My offer that I made to you is off the table. Have a nice day."