Because the me in teach me math is the indirect object of the verb teach, its direct object is math. In fact, this phrase is equivalent to teaching me math-teaching me math, not my math, so there is no need to use mine here.
The verb ask is the same with double objects. Ask someone. Something. Ask someone so-and-so, so this is also the objective situation of me or others.
Answering my question is to answer my question as the only answer.