How do you prove this involving Gaussian integers? Q: Show that $\frac{z}{z^2+w^2}\not\in\mathbb{Z}[i]$ for all $z,w\in\mathbb{Z}[i]\backslash\{0\}$.
My solution is to consider the function $f:\mathbb{R}^4\rightarrow\mathbb{R}$,
$$f(a,b,c,d)=|z^2+w^2|^2-|z|^2$$
where $z=a+bi$ and $w=c+di$ with $a,b,c,d\in\mathbb{Z}$, and then to prove $f$ is always greater than $0$.
Is there a more concise or number-theory-like way to prove this? I think it might require the properties of squares of Gaussian integers.
Actually this is a intermediate step in proving the determinant of a quaternion lattice does not depend on the choice of basis. If there is an alternative proof for that I will be more than happy if you could write that down.
 A: Let’s try a different strategy from yours, but using the fact that $\Bbb Z[i]$ is a unique factorization domain, and the factorization of the denominator as $(z+iw)(z-iw)$.
We may as well assume that $z$ and $w$ have no common (prime) factor $\pi$, for then we could divide top and bottom by $\pi$ to write our fraction as $\frac1\pi\frac{z'}{{z'}^2+{w'}^2}$, certainly a non(Gaussian)integer if the second fraction is nonintegral.
Under the assumption then that $z$ and $w$ have no common factors (which also excludes the embarrassing possibility that $w=\pm iz\,$), we see that $z$ is also relatively prime to $z+iw$ and $z-iw$, so that the original fraction is definitely reduced.
There’s only one dreadful possibility remaining, that both $z+iw$ and $z-iw$ are units, for instance, maybe $z+iw=1$ and $z-iw=i$. But that possibility gives $2z=1+i$, $z\notin\Bbb Z[i]$. And I confess that I have not run through all sixteen cases, but it seems that all of them yield either $z\notin\Bbb Z[i]$ or $w\notin\Bbb Z[i]$. (There may be a slick way of avoiding that enumeration.)
A: HINT.-In order that $\frac{z}{z^2+w^2}\in\mathbb{Z}[i]$ you need that $z^2+w^2$ be invertible. On the other hand, it is well known that the only units (i.e. invertible elements) of $\mathbb{Z}[i]$ are $\pm1$ and $\pm i$.
It follows you need $$a^2-b^2+c^2-d^2+2(ab+cd)i\in\{1,-1,i,-i\}$$ Since no way to have $2(ab+cd)=\pm1$ it remains to look at $ab+cd=0$ which gives for some integer $k\ne0$ $$(a^2+c^2)(1-k^2)=\pm1\text{ (why?)}$$ It is not hard to see this is impossible in integers.
