You need to be able to prove who you are, but you don't often need to do so.
I have been checked by police on a train from Denmark to Germany; the guy they arrested (or at least, led away) looked a bit like me. They only checked the two of us - a proportionate check, which is allowed by the Schengen rules.
It could be the same on a plane, except presumably they can check when the boarding pass is scanned at security.
I do not normally show a passport travelling from Denmark to Germany, by train or plane.
I have been checked by police on a train from Denmark to Germany; the guy they arrested (or at least, led away) looked a bit like me. They only checked the two of us - a proportionate check, which is allowed by the Schengen rules.
It could be the same on a plane, except presumably they can check when the boarding pass is scanned at security.
I do not normally show a passport travelling from Denmark to Germany, by train or plane.