What does refer the word 'to' at the end of the sentence?
- This is the school which I used to go to.
- This is the school which I used to go.
What's the difference between these two sentences, and which one is grammatically correct?
This is the school which I used to go is not a valid sentence. You don't go school, you go to school.
Some people don't like to end a sentence with a preposition so, to be very formal and correct, you could say This is the school to which I used to go.
Omitting to
at the end of the sentence makes the sentence hang. I guess it would help to dissect the sentence.
Think of the following as the base of the sentence:
This is the school which I used to ....
In the simple past tense, went to
is used.
I went to this school.
In its simple present tense, went to
would be go to
. Append it to the "base" sentence, and you have:
This is the school which I used to ... go to.
Take this sentence for comparison:
This is the school I used to ... attend.
This might not be the most technical explanation, but I hope it helps.