Answer:John asked whether he could borrow the book
Explanation: I think that's the answer
John asked me if he could borrow my book
This is assuming that John is the name of the teacher, changing it to indirect means no dialogue, so if you don't have options I would try
The teacher asked to borrow a book
because this answer is more indirect and doesn't assume anything