Let $A$ be a commutative ring and $\text{Spec}\,A=\bigcup\limits_{i=1}^mD(f_i)$ be a covering by principal open sets. Show that the sequence of modules $$M\stackrel{\alpha}\to N\stackrel{\beta}\to K \,\,\,\,(1)$$ is exact if and only if the sequence $$M_{f_i}\stackrel{\alpha_i}\to N_{f_i}\stackrel{\beta_i}\to K_{f_i}\,\,(2)$$ is exact for all $i=1,...,m$.
Since taking the module of fractions is exact functor, the first part is obvious.
Suppose now that $(2)$ is exact for all $i$. Take $x\in N$ such that $\beta(x)=0$. We need to show that there exists some $y\in M$ such that $\alpha(y)=x$. From $(2)$ we have that for all $i$ there exist $y_i\in M_{f_i}$ such that $$\alpha_i(y_i)=\frac{x}{1}. \,\,(3)$$ For each $i$ there is some $t_i\in M$ and non-negative integer $l_i$ such that $$y_i=\frac{t_i}{f_i^{l_i}}.$$ Then from $(3)$ I obtain that there exists some non-negative integer $s_i$ such that $$f_i^{s_i}(\alpha(t_i)-f_i^{l_i}x)=0.$$ Here I got stuck. What should I do next?
Also from the covering condition I have that $1=a_1f_1+\cdots+a_mf_m$ for some $a_1,...,a_m\in A$ and I should use this somehow.
Maybe it's more suggestive to write $f_i^{s_i}\alpha(t_i) = f_i^{l_i}x$. Now, note that because the $f_i$ generate the unit ideal then so do the $f_i^{l_i}$. Geometrically, this is because $D(f_i) = D(f_i^{l_i})$: a function vanishes at a point if and only if some positive power does. So you can write $1$ as a linear combination of the $f_i^{l_i}$. The last thing to observe is that $x = 1x$.