Is this correct
The teacher said "not to use that again and again".
the teacher ordered him to not to use that again and again.
The sentences provided by you are:
The teacher said "not to use that again and again".
The teacher ordered him to not to use that again and again.
However, note that the sentence provided in the direct speech is wrong. The words written within inverted commas is in indirect speech.
The correct sentence would be:
The teacher said: “Do not use that again and again.”
The correct reported speech would be:
The teacher asked them not to use that again and again.