Is it ok to lift locked armrests on aisle or window seats?
I'll have a go at this, but this answer applies only to the US.

First, is it legal? As far as I can see, yes. There are various regulations (e.g. 14 CFR 121.317) about specific items that passengers have to be briefed on and comply with instructions on. They include smoking, seatbelts, emergency exits, screens and tables etc. But there's no explicit mention of armrests and I didn't see any generic clause like "any other equipment" or whatever. So in the absence of any explicit or general regulation that says you can't, I would say you can.

Second, will it get you "into trouble"? Maybe. As the answer to a related question shows, the FAA doesn't want armrests to become an obstacle to evacuation and they advise crew members to make sure that armrests are locked down for takeoff and landing. Many airlines I've traveled on have an announcement about the armrests, even if there's no regulation that requires it. If the crew ask you to put your armrest down and you refuse then the 'best' thing that can happen is that they decide you're rude but not dangerous and let it go. But if you refuse repeatedly and they decide you're being confrontational or unlikely to follow other instructions then 14 CFR 91.11 would apply:


  No person may assault, threaten, intimidate, or interfere with a
  crewmember in the performance of the crewmember's duties aboard an
  aircraft being operated.


Under that regulation, if the crew decides you're "interfering" with their duties (which include keeping you and everyone else safe), you'll probably get a police escort off the aircraft, especially if alcohol is involved.

But having said all that, I don't think this is a big deal at all. The FAA's concern seems to be about armrests that get stuck at an angle, not about ones that can be fully lifted. I've often seen passengers put up their armrests and I've never heard a crew member comment on it, but if they do ask you to lower them, arguing about regulations would probably be a bad idea.