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.