Let $\widehat{f}(x_1,x_2,\dots,x_n,t)=f(tx_1,\dots,tx_n)$ in the polynomial ring $k[x_1,\dots,x_n,t]$. Then $f$ is homogeneous if and only if
$$
\widehat{f}(x_1,x_2,\dots,x_n,t)=t^nf(x_1,\dots,x_n)
$$
This is different from your definition which is equivalent to this one only over infinite fields. For instance, with your definition, every polynomial over the two element field would be homogeneous.
Suppose $f=gh$; then we have
$$
\widehat{f}(x_1,\dots,x_n,t)=
f(tx_1,\dots,tx_n)=
g(tx_1,\dots,tx_n)h(tx_1,\dots,tx_n)
$$
Now we can write
\begin{align}
g(tx_1,\dots,tx_n)&=g_0+g_1t+\dots+g_at^a,\\
h(tx_1,\dots,tx_n)&=h_0+h_1t+\dots+h_bt^b,
\end{align}
with $g_i,h_j\in k[x_1,\dots,x_n]$, $g_a\ne0$ and $h_b\ne0$. Suppose $f$ is homogeneous; consider the least integer $c$ such that $g_i=0$ for $i<c$, $g_c\ne0$ and the least integer $d$ such that $h_j=0$ for $j<c$ and $h_d\ne0$.
Note that $a+b=n$, $c\le a$ and $d\le b$.
Then the term of degree $c+d$ in $g(tx_1,\dots,tx_n)h(tx_1,\dots,tx_n)$ is (with $g_i=0$ for $i>a$ and $h_j=0$ for $j>b$ and consider everything in the ring of polynomials in $t$ with coefficients in $k[x_1,\dots,x_n]$)
$$
g_0h_{c+d}+g_1h_{c+d-1}+\dots+
g_{c-1}h_{d+1}+g_ch_d+g_{c+1}h_{d-1}+\dots+g_{c+d}h_0
=g_ch_d\ne0
$$
Since $f$ is homogeneous, $\widehat{f}$ has only the leading coefficient (at degree $n$) non zero, as a polynomial in $t$ with coefficients in $k[x_1,\dots,x_n]$, so $c+d=n$ and therefore $c=a$, $d=b$.
Therefore
$$
\widehat{g}(x_1,\dots,x_n,t)=t^ag_a(x_1,\dots,x_n)
$$
Evaluating at $t=1$,
$$
g(x_1,\dots,x_n)=\widehat{g}(x_1,\dots,x_n,1)=g_a(x_1,\dots,x_n)
$$
so we have proved that
$$
\widehat{g}(x_1,\dots,x_n,t)=t^ag(x_1,\dots,x_n)
$$
and therefore $g$ is homogeneous. Similarly for $h$.