Can nonmetals have both positive and negative oxidation numbers?
Yes non metals can have both positive and negative oxidation numbers.
If a non metal combines with a metal, metalloid or non metal with a lower electro negativity than the non metal the non metal will have a negative charge or oxidation number.
An example is Sulfur combining with Hydrogen. Sulfur has a higher electro negativity than Hydrogen and will draw more of the electrons to the Sulfur's side of the chemical bond causing Sulfur to be
If a non metal combines with a non metal with a higher electro negativity than the no n metal then the non metal with have a positive charge.
An example is when sulfur combines with Oxygen. Oxygen has a higher electro negativity that then Sulfur, so Sulfur will " lose" electrons to Oxygen. that is the electrons will be pulled closer to the Oxygen causing Oxygen to have a negative charge and the Sulfur to have a positive charge.
Note Florine having the highest electro negativity is never positive.