Let $A$ be a graded module and $f$ homogenous element of $A$ of degree 1. Let $A(n)$ be the same ring but with new grading: $A(n)_d=A_{n+d}$. I note $\text{deg}(g)=k$ if $g\in A_k$ and $\text{deg}_n(g)=\deg(g)-n$ hence $\text{deg}_n(g)=k$ ie $g\in A(n)_k$.
For all graded ring $B$ with $g\in B$ homogenous the ring $B_g$ has a grading $(B_g)_d$ defined as all the quotients $\frac{h}{g^k}$ with $h$ homogenous and $\text{deg}(h)-k\text{deg}(g)=d$ ie with clear definition $\text{deg}\left(\frac{h}{g^k}\right)=d$.
My question: why $A(n)_{(f)}$ is the homogenous elements of degree $n$ in the localization $A_f$ ie $A(n)_{(f)}=(A_f)_n$.
We should have $\frac{g}{f^k}\in A(n)_{(f)}$ iff $\text{deg}_n\left(\frac{g}{f^k}\right)=0$ iff $\text{deg}_n(g)-\text{deg}_n(f^k)=0$ iff $$ \text{deg}(g)-n-(\text{deg}(f^k)-n)=0 $$ iff $\text{deg}(g)-\text{deg}(f^k)=0$ iff $\frac{g}{f^k}\in A_{(f)}$
Where is my mistake?
You're only supposed to shift the grading on the $g$, not the $f^k$ - remember, $f$ lies in $A$, which is not $A(n)$. $g$ lies in $A(n)$, which is not $A$. If you remember this, everything works out correctly:
$$0 = \deg_{A(n)_f} \frac{g}{f^k} = \deg_{A(n)} g - \deg_A f^k = \deg_A g - n \deg_A f^k$$ implies $$\deg_A g -\deg_A f^k = n,$$ or $\deg_A \frac{g}{f^k} = n$, which is exactly what you want.