I believe the main prohibition is that of Ona'as Devarim (as derived by the Gemara, BM 58b). For instance, one is not allowed to remind a convert about the things he did as a non-Jew, because it might hurt him. Likewise, one may not inquire of a storekeeper how much something is with no intention of buying it, because he'll hurt the storeowner's feelings when the latter's hopes are dashed when he sees the customer isn't actually buying it.
In a similar vein, the Gemara (ibid.) says that one who embarrasses another publicly and one who calls another by a name they dislike, even if they show no response to it, are among those who don't leave Gehinnom (c"v, lo aleinu).
To illustrate the severity of Ona'as Devarim, the Gemara (ibid. 59a-b) recounts a lengthy story regarding the Achnai oven. To make things short, R' Gamliel excommunicated R' Elazar for disagreeing with the Rabbanan and refusing to stand down. Worse, the two Tannaim were brothers-in-law; R' Elazar's wife was R' Gamliel's sister. So every day when R' Elazar davened, his wife would bang pots in the kitchen between his Shemoneh Esrei and Tachanun to prevent him from davening effectively. For one reason or another, she wasn't able to stop him one day, and since he was able to daven effectively, although he didn't intend to do so, his broken heart seeped into his tefillos, and immediately, R' Gamliel died. (If you thought that was long, you should see how the Gemara tells it.)
Another thing to take into account, as mevaqesh, I think, was alluding to, is that since you, I'm assuming, don't want to be hurt, you shouldn't hurt others.
There are also the prohibitions against things such as, but not limited to, lashon hara, hatred, bearing a grudge, and taking revenge. Although one isn't necessarily violating any of these by offending someone else, he may very well be in violation of lifnei iveir if the offended party retaliates.
Finally, depending on who is being offended, a Chilul Hashem might be at stake - "this is how frum Jews treat each other? I want no part of this."
Now comes the more difficult part of the question: where do you draw the line? Obviously Halacha doesn't want you locked up in your house all day to avoid offending others (I'm really in the mood to add a political comment here but I wouldn't want to offend anybody), but I think we've listed enough sources to prove you can't just go around saying whatever you want. My advice is to know your audience. Stay away from certain subjects - ones everyone knows are taboo, like politics (see above) and ones that, if you know the person well enough, you know they would find hurtful, like the examples given in the Ona'as Devarim sugya. And of course, CYLOR when applicable. You're right; a psychologist who can read people well is able to back off when he or she senses that they're stepping on sore topics. But that shouldn't stop the rest of us from trying.
In terms of refraining from action that's offending, I think the same advice should apply. If it's something you know will offend them, try to lessen the pain. As I mentioned in the question you linked about presents: ask yourself if you're refraining for selfish reasons, and honestly decide if you would be acting more selflessly by acting.
As far as people pretending they're hurt, or people pretending they're not hurt, there's nothing you can do about that. If you put in the best but reasonable effort you can to prevent anyone from getting hurt, you can't possibly be expected to do more than that.