# Polynomial whose zero set is made of lines must be homogeneous

Let $f$ be a multivariate polynomial, $f \in \mathbb C[x_1,...,x_n]$.

Suppose that $f(x)=0$ implies that for every $c \in \mathbb C$, $f(c x)=0$.

Does it follow that $f$ is a homogeneous polynomial, i.e. that all terms are of the same total degree?

The converse statement it evident.

Writing $f(x,y) = \sum_{i=0}^n g_i$ where each $g_i$ is homogeneous of degree $i$, we know that for every zero $x,$ we have $0=\sum_{i=0}^n g_ic^i$ so each $g_i$ by itself vanishes on $x$. in particular $g_0=0$.

Write $f=\sum_{i=0}^d f^{(i)}$ where $f^{(i)}$ is the degree $i$ form of $f$. Consider $g(x,t)=\sum_{i=0}^d t^i f^{(i)}\in\mathbb{C}[x_1,...,x_n,t]$. Then for $p\in V(f)$ we have $g(p,t)\in\mathbb{C}[t]$ vanishes identically on $\mathbb{C}$, so its coefficients must be $0$ which implies that $f^{(i)}(p)=0$. Therefore $V(f)\subseteq V(f^{(i)}\mid i=0,...,d)$. The other inclusion is clear. Hence $V(f)=V(f^{(i)}\mid i=0,...,d)$. Using Nullstellensatz we have $(\sqrt f)=\sqrt{I}$ where $I=(f^{(i)}\mid i=0,...,d)$. Note that the $\sqrt I$ is a homogeneous ideal. The left hand side, therefore, is a homogeneous principal ideal which means its generator is homogeneous. Notice that if $\sqrt f$ is homogeneous then $f$ must be homogeneous.
Edit : Even though using Nullstellensatz seems like an overkill, it makes sense since the claim is not correct over nonalgebraically closed fields. Consider $x^2+1$ over $\mathbb{R}$ or $x^p-x$ over the fields of order $p$.