先生がかわりにしてあげます?
I came across this sentence and I cant seem to understand why が is used here. I'm roughly interpreting this as: "shall I substitute for the teacher?/shall I do x in place of the teacher?" But I'm having trouble understanding why が is used here instead of の since I feel like I've seen this same structure used with の before and I've only seen の-が being interchangeable in relative clauses.