As others already mentioned, the problem is that $i$ is not an integer, so the typical modular arithmetic doesn't really make sense here. However, there's a way to get something similar, by working with the gaussian integers $\mathbb Z[i]$, which is the set of complex numbers with integer comoponents together with the usual addition and multiplication. Suppose we take the principal ideal $(10)\subseteq\mathbb Z[i]$, then we look at the image of the elements of $\mathbb Z[i]$ under the natural ring homomorphism $\phi:\mathbb Z[i]\to\mathbb Z[i]/(10)$ (here, we are "looking at the gaussian integers mod $10$"). We do indeed have
$$ i^2=-1=9=3^2=7^2\pmod{10}. $$
But the problem with concluding that $i=3$ or $7$ is that in general, $x^2=y^2$ does not imply $x=y$. It does not even imply $x=\pm y$. That's only true in the field of real numbers. To take a much easier example, note that
$$ 1^2=3^2=5^2=7^2=1\pmod{8},$$
but obviously, $1,3,5,7$ are not equal.