The chemical formula of nitrite and nitrate ion are NO2- and NO3- respectively. The oxidation state can be calculated as follows:
Let the oxidation state of N in nitrite and nitrate ion are x and y respectively. The oxidation state of O is -2.
For nitrite ion
x + (-2)2 = -1
x -4 = -1
x = 4-1
x = +3
For nitrate ion
y +(-2)3 = -1
y -6 = -1
y = 6-1
y = +5
So, the oxidation state of N in nitrite and nitrate ions are +3 and +5 respectively.