The first statement follows from the following fact: If $A$ is a set with measure zero, then $\int_A f\,dm=0$ for any measurable function $f$. Now, if $f=g$ on $S-A$ where $A$ is a set with measure zero, then we have $\int_S f\,dm=\int_{S-A}f\,dm+\int_{A}f\,dm=\int_{S-A}f\,dm=\int_{S-A}g\,dm=\int_{S-A}g\,dm+\int_{A}g\,dm=\int_S g\,dm.$
For the second statement, if $f\geq g$, then $f-g\geq 0$. For $\epsilon>0$, let $S(\epsilon)=\{x | f(x)-g(x)\geq \epsilon\}$ which is a measurable set. Then we have $\tag{1}\int_{S(\epsilon)}(f-g)\geq\epsilon\,m(S(\epsilon)).$ By assumption, we have $\tag{2}0=\int_{S}(f-g)dm=\int_{S-S(\epsilon)}(f-g)dm+\int_{S(\epsilon)}(f-g)dm\geq \int_{S(\epsilon)}(f-g)dm$ since $f-g\geq 0$ on $S$. Combining $(1)$ and $(2)$, we have $m(S(\epsilon))=0\mbox{ for all }\epsilon>0.$ Note that $\{x\in S| f(x)\neq g(x)\}=\{x\in S| f(x)>g(x)\}=\bigcup_{n=1}^\infty S(\frac{1}{n}).$ This implies that $\{x\in S| f(x)\neq g(x)\}$ has measure zero.