I am trying to perform division in $\mathbb{Z}_7 [x]$. I want to divide $f(x)=2x^4+x^2-x+1$ by $g(x)=2x-1$. I end up with $f(x)=g(x)\times (x^3 + \frac{1}{2}x^2 +\frac{3}{4}x-\frac{1}{8})+\frac{7}{8}$.
But what are these fractions in $\mathbb{Z}_7$? If it's an interger, I can understand what that means. But a fraction like $\frac{7}{8}$ doesn't seem like an element in $\mathbb{Z}_7$.
$\mathbb{Z}_7$ is a field. $\frac{7}{8}=7\cdot 8^{-1}\in \mathbb{Z}_7$. In particular, $7=0$, so the fraction is 0. $\frac{1}{8}=\frac{1}{1}=1$, etc. $2\cdot 4=8\equiv 1\pmod{7}$, so $\frac{1}{2}=4$ and $\frac{1}{4}=2$, so $\frac{3}{4}=6$.