To me, the use of “shall” as an obligation is carried by the word “must,” or, to be more formal, “is required to.” The latter is what I would expect in legalese. (If there’s a common term for a way of speaking that ends in -ese" but isn’t its own language, I think it makes sense to call it a dialect.)
The question “Shall I?” and other such uses are handled by “should I?” In fact, I refer to it as the “should” or “ought to” meaning of “shall,” as I can’t think of another word to describe it.
As for “Shall we dance?” that’s covered by “May I have this dance?” or even “Let’s dance,” if it’s intended less formally. No matter the usage of “shall,” I always seem to be able to come up with something that carries the same meaning.
This would explain why I (and most people I know) rarely if ever use it.
It was always complete nonsense that for a long time used to be taught as correct.
In the 17th century, certain authors started asserting that the ordinary future tense was properly “I shall/you will/he will” and emphatic assertions were properly “I will/you shall/he shall,” but there’s no evidence that this distinction was derived from any actual usage.
That’s not really correct. The teacher should respond, you may not. That denies permission. “You shall not” is really only correct, if the teacher intends to make sure it doesn’t happen beyond denying permission.
I’m not sure I understand the distinction here. Of course “you may” means you have permission to (but don’t have to), and “you shall” means you must do it. But “may not” and “shall not” both mean you must not do it.