The question is correctly constructed. I have seen questions of this structure called "wh-in-situ" by linguists because the wh-word remains "in place" (it's where it would be in the corresponding declarative sentence) rather than being fronted.
In some languages, this is the only grammatical way to form questions. In English, fronting the wh-word is the "neutral" option, but wh-in-situ is also grammatical, although "marked" (it usually only occurs in special circumstances).
The World Atlas of Language Structures article on "Position of Interrogative Phrases in Content Questions", by Matthew S. Dryer, mentions two circumstances where non-fronted interrogatives are commonly used in English:
It is possible in English to place an interrogative phrase later in the sentence, but this word order is not normally used in neutral questions. It is used either in echo-questions, where the speaker is expressing surprise or incredulity at something that they have just heard, as in (2a), or by a teacher asking students questions, as in (2b).
a. You are leaving when?!?
b. Napoleon died in what year?
The sentence you asked about,
'Le marteau sans maître' is a famous composition of which composer?
is the same type of sentence as (b), so there is no problem with its word order.
Your other questions are really distinct issues. It is grammatical for a sentence to begin or end with a preposition.
Which composer is 'Le marteau sans maître' a famous composition of?
Of which composer is 'Le marteau sans maître' a famous composition?
These are both grammatical. However, they both sound bad to me. (The second sounds worse than the first.)
If you wanted to use a wh-word at the start of this question, I would re-phrase to something like this:
Who composed the famous composition 'Le marteau sans maître'?