@bodangles - you have a point, of course, but in this case it’s not only the authority of position that the teacher has in this case. It’s also a reasonable case of being partly right, even if we take the OP’s story at total face value.
@Fuffy24 - The teacher was not obviously unreasonable (in which case it might still be advisable to not rebel, if you either need something from the teacher like a grade or recommendation, or if you believe in showing respect to authority as a moral position, or if any number of other considerations) - but in this case, I don’t think we even have to go that far!
As for @Lanaana earlier, “Thinking for oneself” does not mean saying anything that pops into a teenaged head. I say this as someone with great affection for teenagers.