The correct answer is A. will punish.
The verb "punish" is a regular verb, which means that the past tense and past participle are formed by adding -ed to the base form. The future tense is formed by adding will + the base form.
In this sentence, the teacher is threatening to punish the student if they go to school late. This means that the punishment is something that is going to happen in the future, so the correct verb form is will punish.
The other options are incorrect because they do not express the future tense. Option B, punish, is the simple present tense, which is used to talk about things that happen regularly or repeatedly. Option C, punishing, is the present participle, which is used to form the present progressive tense and the perfect tenses. Option D, will have punished, is the future perfect tense, which is used to talk about things that will have happened by a specific time in the future.
In conclusion, the correct answer is A. will punish.