Localization of finite direct product of ring at an element Given a finite direct product of rings $A_1\times A_2\times\cdots\times A_n$, what is the localization of the product ring at an element $f:=(f_1,f_2,...,f_n)$. 
There is a similar question Localization of a direct product, but the subtlety is the multiplicative set is not $S_{f_1}\times S_{f_2}\times \cdots\times S_{f_n}$.
This problem comes form my try to prove the isomorphism of structure sheaves by checking the isomophism on distinguished opens.
$$
\mathcal{O}_{\operatorname{Spec} \prod_i A_i}(D(f))\cong \mathcal{O}_{\coprod_i \operatorname{Spec} A_i} \left( \coprod_i D(f_i) \right)
$$
These two sheaves should be isomorphic and implies
$$
\left(\prod_i^n A_i\right)_f \cong \coprod_i (A_i)_{f_i}.
$$
Is this true or did I make some mistakes in this derivation?
 A: If $f = (f_1,\dots,f_n)$, then $(\prod_{i=1}^n A_i)_f \cong \prod_{i=1}^n (A_i)_{f_i}$.
I'll give you a really concrete proof. The morphism is obtained from the universal properties of the objects: For each $i$, there is a natural map $(\varphi_i\circ \pi_i)\colon \prod_{i=1}^n A_i \to A_i \to (A_i)_{f_i}$, and $(\varphi_i\circ \pi_i)(f) = f_i/1$, which is a unit in $(A_i)_{f_i}$. This induces a natural map $(\prod_{i=1}^n A_i)_f\to (A_i)_{f_i}$ for all $i$, and hence a natural map $\psi\colon (\prod_{i=1}^n A_i)_f\to \prod_{i=1}^n (A_i)_{f_i}$. Explicitly, $$\psi((a_1,\dots,a_n)/f^k) = (a_1/f_1^k,\dots,a_n/f_n^k)$$
Now we want to show that this map is injective and surjective.
Injectivity: If $\psi((a_1,\dots,a_n)/f^k) = 0$, then for all $i$, $a_i/f_i^k = 0$, so there exists $m_i$ such that $f_i^{m_i}a_i = 0$. Let $m = \max(m_1,\dots,m_n)$. Then $f^m(a_1,\dots,a_n) = (f_1^ma_1,\dots,f_n^ma_n) = 0$, so $(a_1,\dots,a_n)/f^k = 0$.
Surjectivity: Take any $(a_1/f_i^{k_1},\dots,a_n/f_n^{k_n}) \in \prod_{i=1}^n (A_i)_{f_i}$. Let $k = \max(k_1,\dots,k_n)$. Then $\psi((a_1f_1^{k-k_1},\dots,a_1f_1^{k-k_1})/f^k) = (a_1/f_i^{k_1},\dots,a_n/f_n^{k_n})$.

In the comments, user1trill asks if the isomorphism still holds in the case of infinite products. The answer is no.
Let $A_n = \mathbb{Z}/(2^n)$ for all $n$. Consider $\prod_{n\in \mathbb{N}}A_n$, and let $f = (2,2,2,\dots)$ in this ring. Recall that the localization of a ring at an element is the zero ring if and only if the element is nilpotent. Since $f_n = 2$ is nilpotent in $A_n$ for all $n$, we have $\prod_{n\in \mathbb{N}}((A_n)_{f_n}) = \prod_{n\in \mathbb{N}} 0 = 0$. On the other hand, $f$ is not nilpotent in $\prod_{n\in \mathbb{N}}A_n$, so $(\prod_{n\in \mathbb{N}}A_n)_f \neq 0$.
This shows $(\prod_{n\in \mathbb{N}}A_n)_f\not\cong \prod_{n\in \mathbb{N}}((A_n)_{f_n})$ in general, and in particular that the canonical map can fail to be injective.
It is also possible for surjectivity to fail. Let $A_n = \mathbb{Z}$ for all $n$, consider $\prod_{n\in \mathbb{N}}A_n$, and again let $f = (2,2,2,\dots)$. The natural map $(\prod_{n\in \mathbb{N}}A_n)_f\to \prod_{n\in \mathbb{N}}((A_n)_{f_n})$ maps $(a_0,a_1,a_2,\dots)/(2^k,2^k,2^k,\dots)$ to $(a_0/2^k,a_1/2^k,a_2/2^k,\dots)$. This is not surjective: $(1/2^1,1/2^2,1/2^3,\dots)$ is not in the image.
A: Both  Alex Kruckman and user26857 have given the correct answer either in post or in comment. Thanks. I think I should post some part of my mistake so that this thread would be helpful for future readers.
Initially, I made a mistake to define the structure sheaf 
$$
\mathcal{O}_{\coprod_i\operatorname{Spec}  A_i}:= \coprod_i (\iota_{i})_*\mathcal{O}_{\operatorname{Spec} A_i},
$$
where $(\iota_i)$ is the inclusion $\operatorname{Spec} A_i\rightarrow\coprod_i\operatorname{Spec} A_i$. But it should be 
$$
\mathcal{O}_{\coprod_i\operatorname{Spec}  A_i}:= \prod_i (\iota_{i})_*\mathcal{O}_{\operatorname{Spec} A_i},
$$
to make sure there are natural restriction maps. This is where my confusion comes from.
As for my naive comment to claim that I can check the universal property of coproduct.

where 
$$
\alpha:\frac{a}{f^n}\mapsto \frac{(a,g^n)}{(f,g)^n}
$$
$$
\beta:\frac{b}{g^m}\mapsto \frac{(f^m,b)}{(f,g)^m}
$$
Given $\phi$ and $\psi$, there is a morphism $u$ to make diagram commute.
$$
u:\frac{(a,b)}{(f,g)^k}\mapsto \psi\left(\frac{a}{f^k}\right)\phi\left(\frac{b}{g^k}\right)
$$
I thought I had checked the universal property at this point but now it seems to me though all of $\alpha,\beta,u$ are well-defined ring morphisms, $u$ may well be not unique.
