I think that if something needs to be said or done then the fact that it might offend someone shouldn't stop you from saying or doing it. That being said, it is important to recognise that things do not always need to be said and in many situations a certain amount of sensitivity is sensible.
I certainly don't think you should set out to offend people, it shouldn't be your primary aim. If you are minding your own business and doing things that need to be done and people happen to be offended along the way, that is much more defensible in my opinion.
The biggest issue surrounding all of this for me is comedy, it is often very difficult to know where to draw the line. Personally as long as you are clear when you are joking and when you are not, and you're not being an ***, then I don't have a massive issue with offensive jokes, but it's understandably all extremely subjective.
I think it's important to take on board the opinion of whomever you are dealing with and just be reasonable and understanding with it all, although fundamentally if you feel something really needs to be said you shouldn't let anything hold you back from saying it.