I think you are suffering from some kind of eating disorder
mostly anorexia nervosa
.You need to visit your docter to discuss this problem ,he might run a few test to rule out depression
,infection and other rare autoimmune disorders
.Not eating is definitely bad because if you dont maintain a good health then you might get oppurtunistic infection due to poor immunity.