I am studying chapter 10 from Gathmann's notes about algebraic geometry and there is something I don't understand in the following proof.
I don't really understand the equality $\frac{g}{f} = c g$. If I understand well, the aim of this part is to show that $S^{-1}(I(a)/I(a)^2) \subseteq I(a)/ I(a)^2$ so that we can deduce the ismorphism since the other inclusion is trivial. So this equality has to be understood as an equality in $S^{-1}(I(a)/I(a)^2)$, i.e. $$\frac{g}{f} = \frac{cg}{1} \quad \Leftrightarrow \quad \exists t \in S, ~t(g - cf g) = 0 \text{ in }A(X).$$ But I really don't see how we deduce from the first part that $\exists t \in S, ~t(g - cf g) = 0 $ since $f$ is invertible in $A(X)/I(a)$, not in $A(X)$. Any help ?

Take two arbitrary elements $f\in A(X)/I(a)$ and $g\in I(a)/I(a)^2$. Then, by abuse of notation also denoting some representative of $f$ and $g$ by $f$ and $g$ respectively, we have
$$(f+I(a))(g+I(a)^2) = fg + \underbrace{fI(a)^2}_{\in I(a)^2} + \underbrace{gI(a)}_{\in I(a)^2} + I(a)^3 = fg + I(a)^2, $$
and hence $fg \in I(a)/I(a)^2$ (in the above calculation, read '+I(a)' as 'there is an element in $I(a)$ s.t. the equation holds' and analogously for higher powers).
It is clear that $\frac{1}{f} = c$ in $A(X)/I(a)$. Then by the above argumentation,
$$g\frac{1}{f} = \frac{g}{f} = cg \in I(a)/I(a)^2.$$
The argument this is that if we would localize $I(a)/I(a)^2$ at $S$, the only new elements would be of the form $\frac{g}{f}$ with $f\in S$, but we just showed that they already lay in $I(a)/I(a)^2$, so that localization does not add any new elements.