Prove that $f$ is well defined
means the following:
An element of $S^{-1}M$ is an equivalence class of "fractions" $m/s$. Prove that $f(m/s)$ remains the same no matter what representative for the equivalence class of $m/s$ you choose.
(This is more or less always what it means when an exercise tells you to prove that a function is well-defined.) So, two fractions $m/s$ and $n/t$ represent the same equivalence class if there is an $u\in S$ such that $u(tm - sn) = 0$. So, let's see what happens to the two fractions if we use $f$ on them: $ f(m/s) = 1/s \otimes m \\ f(n/t) = 1/t\otimes n $ Now, the question is, do they represent the same element in $S^{-1}A \otimes_A M$? The usual way to test this is to take the difference between the two results and verify that it equals $0$. But as they stand it's not easy to calculate the difference, since the two tensor products have no terms in common. We need to fix that.
In $S^{-1}A$, we have that $1/s = ut/ust$, and likewise, $1/t = us/ust$, so we get (by bilinearity of tensor product): $ 1/s \otimes m = ut/ust \otimes m = 1/ust\otimes utm \\ 1/t \otimes n = us/ust \otimes n = 1/ust\otimes usn $ Now we can calculate the difference between these two as $ 1/ust\otimes utm - 1/ust\otimes usn = 1/ust\otimes (utm - usn) = 1/ust\otimes 0 = 0 $ and thus the value of $f$ at $m/s$ in independent of the choice of representative, and $f$ is therefore well defined. Can you make a similar reasoning for $g$? Can you prove that $f\circ g$ and $g\circ f$ are the identity functions on their respective $A$-modules? What does this tell us about the relationship between $S^{-1}A \otimes_A M$ and $S^{-1}M$?