2 Answers
2

The negative of English verbs is formed with the appropriate form of the auxiliary verb do followed by not (or its contraction) and the plain form of the main verb. I knew, for example, becomes I didn’t know in the negative.

In the same way, I used to becomes I didn’t use to. In speech, /d/ is the voiced version of /t/, which means that the /t/ at the beginning of ‘to’ may sometimes be heard, or even pronounced, as /d/, giving the impression that what is being said is I didn't used to. In writing, however, it should always appear as use.

"I didn't use to" is grammatically correct. Only one element of the main verb can carry the tense marker. If you say *"I didn't used to", two elements are carrying the past tense marker: "didn't" & "used".