At the gate, will I need to show my ID, for most flights?
Hard to say, as it depends on the airline and possibly the country. My own experience is mostly in Western Europe with both legacy and low-cost carriers and I would say there is more often an ID check on than not, especially with low-cost carriers.
What can I show to the airline other than my passport as ID? e.g non-EU national identity card, some kind of QR code or app, photocopy of my passport
If they do ask, it becomes difficult for them to accept random documents. In particular, a copy of a passport with a vaguely resembling photo is often used by people staying illegally. I don't remember ever witnessing someone trying that in air transport (it's more common in busses) but it seems more likely to attract attention than solve your problem.
If my passport needs a visa to enter Schengen area, is the airline need to check if I have this visa (or residence permit)? Reminding again that this is a flight from one Schengen country to another
I don't think they really need to do it and most do not. It's been a very long time since I flew with them but Ryanair reportedly does check your visa status as well.
As @jcaron pointed out, police checks are also possible for different reasons and in that case you status is very likely to be challenged (although even that isn't systematic: I once witnessed two police officers checking every passengers right out of the door of a plane looking for someone who had been reported for taking her kid out of the country during a custody dispute; they just scanned the names on the passports spending absolutely no time on citizenship, visa, status, etc. until they found the person they were looking for).
If I have a residence permit card of a Schengen country, can I show that to the airline instead of my passport, for most flights?
Even harder to judge but it seems very risky.
While entering/leaving Schengen area, can I use residence permit card of a Schengen country instead of passport? For both border agents and airline.
Legally you may not, you need the residence card and the passport. The Schengen Borders code is explicit about that and airlines are unlikely to take chances.
It may actually be easier at the border, especially if you have a residence country from the country you are trying to enter (and not from another Schengen country). In some countries, a local residence permit is enough for all official purposes and border guards do have means to find out more about your status. There are also countries where this is explicitly forbidden and a passport is always required but I am not sure you would necessarily be removed. It sounds risky in any case.