Consider a finite field $\mathbb{F}_q$ and polynomials $g(x),h(x)$ over $\mathbb{F}_q.$ Define $$ f(x,y)=xy+g(x)+h(y)\quad\forall (x,y)\in\mathbb{F}_q\times\mathbb{F}_q, $$ $$ N(x)=\left\{y\in\mathbb{F}_q:~f(x,y)=0\right\}. $$ Want to prove that $$\sum_{x\in\mathbb{F}_q}|N(x)|(|N(x)|-1)\leqslant q(q-1).$$ I have that:
- Since \begin{align*} f(x_1,y_1)+f(x_2,y_2)-f(x_1,y_2)-f(x_2,y_1)&=x_1y_1+x_2y_2-x_1y_2-x_2y_1 \\ &=(x_1-x_2)(y_1-y_2), \end{align*} it is seen that $$ \left(x_1\neq x_2,~y_1\neq y_2\right)\Rightarrow \left(y_1\notin N(x_1) \vee y_1\notin N(x_2) \vee y_2\notin N(x_1)\vee y_2\notin N(x_2)\right). $$
- Consider the undirected bipartite graph $K_{q,q}$ with classes $X=\left\{x\in\mathbb{F}_q\right\},~Y=\left\{y\in\mathbb{F}_q\right\}$ and ($(x,y)$ is edge iff $y\in N(x)$). From the first statement I see that such graph has no 4-cycles. The problem in these therms (as I see) is to prove the estimate $$ \sum_{x\in\mathbb{F}_q}\deg(x)(\deg(x)-1)\leqslant q(q-1). $$ Also it is known that $\sum_{x\in\mathbb{F}_q}\deg(x)$ is the number of edges in $K_{q,q}.$