(N/A) The valence or oxidation state is a characteristic property of elements,determined by their electronic configurations.
$1$. In $OF_2$,oxygen exhibits an oxidation state of $+2$,whereas in $Na_2O$,it exhibits $-2$.
$2$. The electronegativity order is $F > O > Na$.
$3$. In $OF_2$: Fluorine $(2s^2 2p^5)$ is the most electronegative element,so it is assigned an oxidation state of $-1$. Since there are two fluorine atoms,oxygen $(2s^2 2p^4)$ must share two electrons to complete its octet,resulting in an oxidation state of $+2$.
$4$. In $Na_2O$: Oxygen is more electronegative than sodium. Sodium $(3s^1)$ loses one electron to oxygen,acquiring an oxidation state of $+1$. Oxygen accepts two electrons (one from each sodium atom),resulting in an oxidation state of $-2$.