Consider a bivariate polynomial over the finite field $\mathbb{Z}_n$ of the form: $$f(x,y) = c\cdot xy + g(y)$$
where $c$ is some non-zero constant and $g$ is some univariate polynomial.
Let $\omega_n$ be a primitive $n$th root-of-unity. Consider the function $h : \mathbb{Z_n} \to \mathbb{C}$: $$h(x) = \sum_{y\in \mathbb{Z}_n} \omega_n^{f(x,y)}$$
I'm interested in when $h$ corresponds to a function over the same finite field, i.e. when the codomain of $h$ (up to a scalar) consists of $n$th roots-of-unity.
For example, take $f$ to be the polynomial $xy+y^2$ over $\mathbb{Z_5}$. This gives the following evaluations of $h(x)$:
$$h(0) = \omega_n^{0} + \omega_n^{1} + \omega_n^{4} + \omega_n^{4} + \omega_n^{1}$$ $$h(1) = \omega_n^{0} + \omega_n^{2} + \omega_n^{1} + \omega_n^{2} + \omega_n^{0}$$ $$h(2) = \omega_n^{0} + \omega_n^{3} + \omega_n^{3} + \omega_n^{0} + \omega_n^{4}$$ $$h(3) = \omega_n^{0} + \omega_n^{4} + \omega_n^{0} + \omega_n^{3} + \omega_n^{3}$$ $$h(4) = \omega_n^{0} + \omega_n^{0} + \omega_n^{2} + \omega_n^{1} + \omega_n^{2}$$
Note that $h(1) = h(4) = \omega_n^{1}\cdot h(0)$ and $h(2) = h(3) = \omega_n^{4}\cdot h(0)$. Therefore, taking the value of $h(0)$ as a scalar, $h(x)$ is equivalent to the function $x^2$ over $\mathbb{Z_5}$ (i.e. 0,1,4,4,1).
It seems that when $g$ is quadratic, $h$ corresponds to a quadratic function (over the finite field) as well (although not always identical as in the case above). Is this true? If so, what exactly is the relationship between $f$ and the function corresponding to $h$?
Similarly, it seems that when $g$ is cubic or above, $h$ does not correspond to a function over the finite field. Is this always true?
I'm sure there must be better terms to explain what I'm describing here - any pointers to relevant fields would also be helpful!
It works out as follows whenever $g$ is a quadratic polynomial and $n>2$, i.e. $n=p$ is an odd prime.
Let's write $$ g(x)=a_2x^2+a_1x+a_0 $$ for some coefficients $a_0,a_1,a_2\in\Bbb{Z}_p,a_2\neq0$. All we need to do is to complete the square in the exponent. That is, let's rewrite $$ cxy+g(y)=a_2y^2+(a_1+cx)y+a_0=a_2\left(y+\frac{a_1+cx}{2a_2}\right)^2+a_0-\frac{(a_1+cx)^2}{4a_2}. $$ In the definition of $h$ the variable $x$ is a constant in the summation. Therefore we can as well use $t=y+(a_1+cx)/(2a_2)$ as the variable in the summation: when $y$ ranges over the field $\Bbb{Z}_p$ so does $t$. Therefore $$ \begin{aligned} h(x)&=\sum_{t\in\Bbb{F}_p}\omega^{a_2t^2+a_0-((a_1+cx)/(2a_2))^2}\\ &=\omega^{a_0-(a_1+cx)^2/(4a_2)}\sum_{t\in\Bbb{Z}_p}\omega^{a_2t^2}\\ &=\omega^{p(x)} S(a_2), \end{aligned} $$ where $$ p(x)=-\frac{c^2}{4a_2}x^2-\frac{ca_1}{2a_2}x-\frac{a_1^2-4a_0a_2}{4a_2}\in\Bbb{Z}_p[x] $$ is the quadratic function corresponding to $h$, and the constant (independent of $x$!) $$ S(a_2)=\sum_{t\in\Bbb{Z}_p}\omega^{a_2t^2} $$ is, indeed, a Gauss' sum.
The Gauss' sum is a complex number with absolute value equal to $\sqrt p$. When $a_2=1$, and $\omega=e^{2\pi i/p}$ it is known that $S(1)=\sqrt{p}$, if $p\equiv 1\pmod 4$, and $S(1)=i\sqrt{p}$, if $p\equiv-1\pmod4.$ See for example this Wikipedia article for some basic properties of Gauss' sums. A textbook would be better. Number theorists probably recommend Ireland & Rosen, books on Finite Fields such as Lidl & Niederreiter will also have this (and generalizations to other finite fields).