The question is about what happens to phrases during the time of making them questions.
We know that the following sentence is a normal English sentence which is correct grammatically.
- He found a friend to study with.
The bold part in the sentence is a phrase and "to study with" refers to "a friend". That's why it would be wrong to say "To study with, He found a friend".
The problem starts here. While asking a question, we have to separate them from each other and according to many linguistics, phrases separated in a question form don't refer to each other anymore, and those questions are generally wrong.
Do you think that the following questions are correct?
Who did he find to study with?
Which friend did he find to study with?
I am not sure but my English teachers (native) said that they were awkward. Because there is "to study with" but there is no noun next to it. Why do they consider these sentence structures incorrect only as questions?
(Here, I am sharing with you a link which prohibits those kinds of questions such as "What did you sell a book about?" because of the same problem. http://www.ling.upenn.edu/~beatrice/syntax-textbook/ch12.html)