Indirect speech for “Was there a chair there at the last lesson”

The direct speech in your example is a question which asks if there was a chair there at some time in the past. When you report it, you place the question further back in time, so that it becomes Somebody asked if there had been a chair there at the last lesson.