Breakdown of Man löst das Problem, indem man den Lehrer fragt.
fragen
to ask
das Problem
the problem
der Lehrer
the teacher
man
one / you (impersonal)
Questions & Answers about Man löst das Problem, indem man den Lehrer fragt.
How does indem affect the sentence structure here?
indem is a subordinating conjunction used to describe the method or means of doing something (answering the question "how?"). Like all subordinating conjunctions in German, it kicks the conjugated verb to the very end of its clause. That is why fragt is the last word in the sentence.
Why does the second part of the sentence say man den Lehrer fragt instead of just translating "by asking the teacher" directly?
In English, you can drop the subject after "by" and just use an "-ing" verb ("by asking"). German doesn't do this with indem. Because indem introduces a full subordinate clause, that clause must have its own subject and conjugated verb. Since the main clause is about a general "you" or "one" (man), we repeat man as the subject in the second clause.
Why is it den Lehrer and not der Lehrer?
The teacher is the person being asked, making him the direct object of the verb fragen (to ask). Direct objects take the accusative case. Since Lehrer is a masculine noun, its "the" article changes from der to den in the accusative.
The English translation says "You solve", but shouldn't "you" be du?