If two polynomials have the same absolute value everywhere, they differ by a unit Let $k$ be a local field with absolute value $|\cdot |$.  Let $f, g \in k[t_1, ... , t_n]$ be nonzero polynomials with $|f(x_1, ... , x_n)| = |g(x_1, ... , x_n)|$ for all $(x_1, ... , x_n) \in k^n$.  Do we have $f = c g$ for some $c \in k$ with $|c|=1$?
This is true for $k = \mathbb C$; by the open mapping theorem, the image of a nonconstant meromorphic function cannot be contained in the unit circle.
I don't know about $k = \mathbb R$ or a nonarchimedean field.  I was considering an example like $f(x) = x - i$ and $g(x) = x+ i$, where we do have $|f(x)| = |g(x)|$ for all $x \in \mathbb R$.  But this is not a true counterexample since the coefficients of $f$ and $g$ do not lie in $\mathbb R$.
 A: Let $p$ be a prime. Let $k = \Bbb{Q}_p,$ and let $f(t) = \alpha + pt^2$ and $g(t) = \beta + pt^2,$ where $\alpha$ and $\beta$ are distinct units in $\Bbb{Z}_p.$
If $a = 0$ then $f(a) = \alpha$ and $g(a) = \beta$ are units in $\mathbb{Z}_p$, so $|f(a)| = |g(a)| = 1$. Next let $a\in\Bbb{Q}_p^\times$ be arbitrary, and write $a = up^n$ with $u\in\Bbb{Z}_p^\times,$ $n\in\Bbb{Z}.$ Then we have $f(a) = \alpha + p^{2n+1}u$ and $g(a) = \beta + p^{2n+1} u.$ We also see that
$$\left|f(a)\right| = \left|\alpha + p^{2n+1}u\right|\leq\max(\left|\alpha\right|,\left|p^{2n+1}u\right|) = \max(1,\frac{1}{p^{2n+1}}),$$
and similarly for $\left|g(a)\right|.$
We know that the nonarchimedean triangle inequality $\left|a + b\right|\leq\max(\left|a\right|,\left|b\right|)$ is an equality if $\left|a\right|\neq \left|b\right|.$ In particular, as $\frac{1}{p^{2n+1}}\neq 1$ for any $n\in\Bbb{Z},$ we in fact have $\left|f(a)\right| = \max(1,\frac{1}{p^{2n+1}}) = \left|g(a)\right|$ for any $a\in\Bbb{Q}_p.$
But, $f$ and $g$ are not multiples of each other. Indeed, suppose that $\alpha + pt^2 = c\beta + cp t^2$ for some $c\in\Bbb{Q}_p.$ Then it would follow that $\alpha - c\beta = 0$ and $p - cp = 0,$ but this is impossible -- the latter equation implies that $c = 1,$ but the former implies that $c = \alpha/\beta\neq 1.$
A: It's true for $\ k=\mathbb{R}\ $. If $\ \left|f\left(x\right)\right|= \left|g\left(x\right)\right|\ $ for all $\ x \in\mathbb{R}^n\ $ and $\ f\ne g\ $ then there exists $\ x_1 \in\mathbb{R}^n\ $ such that $\ f\left(x_1\right)\ne g\left(x_1\right)\ $.  Let $\ x \in\mathbb{R}^n, x\ne x_1\ $ and $\ y(t)=tx+(1-t)x_1\ $ for $\ t\in \mathbb{R}\ $.  Then
\begin{align}
0&=\left|f\left(y(t)\right)\right|^2- \left|g\left(y(t)\right)\right|^2\\
&=\left(f\left(y(t)\right)-g\left(y(t)\right)\right)\left(f\left(y(t)\right)+g\left(y(t)\right)\right)\ \ \text{ for all }\ t\in \mathbb{R}\ .
\end{align}
Since $\ f\left(y(t)\right)-g\left(y(t)\right)\ $ is a non-zero  (since $\ f(y(0))-g(y(0))=$$ f\left(x_1\right)- g\left(x_1\right)
\ne0\ $) univariate polynomial in $\ t\ $, it has at most a finite number of zeroes.  Therefore $\ f\left(y(t)\right)+g\left(y(t)\right)\ $, also a univariate polynomial in $\ t\ $,  vanishes on a dense subset of $\ \mathbb{R}\ $ and must therefore be identically $0$. In particular, $\ f\left(y(1)\right)+g\left(y(1)\right)=$$f\left(x \right)+g\left(x\right)=0\ $ and $\ f\left(y(0)\right)+g\left(y(0)\right)=$$f\left(x_1 \right)+g\left(x_1\right)=0\ $. Thus, since $\ x\ $ was an arbitrary element $\ \ne x_1\ $ of $\ \mathbb{R}^n\ $, it follows that  $\ f(x)=-g(x)\ $ for all $\ x\in \mathbb{R}^n\ $.
