Let $f: B \to A$ a ring morphism and $g \in B$.
My goal is to show that $A_{f(g)} \cong A \otimes _B B_g $
($B_g$ means localization at $g$)
Firstly using universal property of tensor product the canonical maps $A \to A_{f(g)}, B_g \to A_{f(g)}$ induce a map $h:A \otimes _B B_g \to A_{f(g)}$. Obviously it's surjective since $A$ and the multiplicative system $\{ f(g)^n \vert n \in \mathbb{N}\}$ are contained in the image.
Does anybody have an argument for injectivity?
This should follow from the following more general fact: Let $M$ be a $B$-module. Then, given any multiplicative system $S$ in $B$, we have $$ S^{-1}M\cong M\otimes_B S^{-1}B $$ as $B$-modules.
In your particular case we take $S=\{1,g,g^2,\dots\}$ and $M=A$ as a $B$-module. All that'd remain to show is that this map is also a(n iso)morphism in whatever category you have in mind ($B$-algebras, commutative rings?).
For a proof of this standard result see Lemma 6.19 in these notes by Gathmann: https://www.mathematik.uni-kl.de/~gathmann/class/commalg-2013/commalg-2013-c6.pdf