'Need' is what we call a 'semi-modal'. This means that it sometimes works like a modal verb ( like 'must', 'can', 'may' 'will') and it sometimes works like a normal kind of verb ( like 'want').
Modal verbs form questions by inversion, negatives by simply adding 'not' or 'nt' and are followed by the bare infinitive. When 'need' is in its modal form, the question is 'Need I go?' and the negative is 'I needn't go'.
Ordinary verbs form questions and negatives with 'do' in simple tenses and are followed by 'to' before the infinitive. When 'need' is in its (let's call it) 'ordinary verb' form, the question is 'Do I need to go?' and the negative is 'I don't need to go'.
There is rarely any difference in meaning between the two forms. The modal form, 'needn't', is quite formal and old-fashioned. It is much more unusual than the more regular form, 'don't need to', and also much less useful. I wouldn't worry about trying to use 'needn't, if I were you.