The -lig/ligt ending means something like 'alike' or 'just as'. For example, the word 'mänsklig' litterally means 'human-like', 'like a human' or 'just as a human does /would do'.
In this case, 'dålig' is a very old word, so it may be hard to see its origin. However, in Danish (I'm not sure with Swedish) we have the word 'dåre' which means an idiot or a simple-minded person. 'Dålig' is also spelled as 'dårlig' in Danish.
It is, but personally I would say it is mostly used if someone did well at an activity of some sort. If you're talking about the quality of for example a movie or some food I would be more inclined to use "inte dum" (literally: "not dumb"). I think you can still use "inte dålig" to talk about that though, so it may just be me who sees it as different.
In Yorkshire "not bad" was almost the highest degree of praise you ever got from parents or teachers. This nearly ended my relationship with my girl friend when I used it to appreciate the first meal she cooked for me. We've been married for 56 years now (17 of them in Yorkshire) and it's what she says to me when she's eaten my production.
You can say that the movie was inte dålig, in that case dålig is an adjective that modifies a noun. But if you ask how someone is doing, you'll be answering the question how and therefore you'll need an adverb instead. So if you ask Hur mår du? 'How are you?', I could answer Jag mår inte dåligt which would mean that I am not feeling bad.