A problem with a quadric contained in a hyperplane Let $f(x)=\sum_{i,j=1}^n a_{ij}x_ix_j+2\sum_{i=1}^n b_i x_i+c$ for $x\in \mathbb R^n$ where the coefficients $a_{ij},b_i,c$ are real, $a_{ij}=a_{ji}$ and not all $a_{ij}$ are equal zero. Let
$$
Q:=\{x\in \mathbb R^n : f(x)=0\}
$$
 Let us assume that a $Q$ is contained in the set
$$
H=\{x\in \mathbb R^n: x_n=0\}.
$$ 
How to prove that $Q$ has to be an affine subspace (possible empty) of $\mathbb R^n$?
Thanks
 A: EDIT 2. We show that $f(x)=\pm ((f_1(x))^2+\cdots+(f_k(x))^2+ux_n^2)$ where $u>0$ and the $f_i$ are affine. In particular, the form $f(x)=\pm ux_n$ is impossible because the matrix $A=[a_{i,j}]$ is not zero.
Proof. Let $y=(x_i)_{i\leq n-1}$. Then $f(x)=f_1(y)+ux_n^2+x_nf_2(y)$ where $f_1$ has degree $2$ and $f_2$ has degree $1$. 
Case 1. $u=0$. Assume that there is $y_0$ s.t. $f_1(y_0)\not=0$. If $f_2(y_0)=0$, then $Q$ is empty. If $f_2(y_0)\not=0$, then there is a solution $x_n\not=0$, a contradiction. Thus $f_1=0$ and $f(x)=x_nf_2(y)$.
If there is $y_0$ s.t. $f_2(y_0)=0$, then there is a non-zero solution in $x_n$, a contradiction. Thus $f_2$ is a constant $a\not=0$ and $f(x)=ax_n$, that is contradictory because the matrix $A=[a_{i,j}]$ is not zero.
Case 2. $u\not=0$. For example $u>0$. If there is $y_0$ s.t. $f_1(y_0)<0$, then $f(y_0,0)<0$ and $f(y_0,x_n)>0$ for $x_n>0$ large enough, that is contradictory. 
Then $f_1\geq 0$. Let $g(y,z)$ be homogeneous of degree $2$ s.t. $g(y,1)=f_1(y)$; if $z\not=0$, then $g(y,z)=z^2g(y/z,1)\geq0$; since $g(y,0)=0$, we deduce that $g\geq0$ and can be decomposed in a sum of squares of linearly independent forms $g=\sum_ig_i^2$; finally  $f_1(y)=g_1(y,1)^2+\cdots+g_k(y,1)^2$ where the $g_i(y,1)=h_i(y)$ are linearly independent affine functions. Note that at most one $h_i$ may be a constant. Let $H=(h_i)$.
Now $f(x)=h_1^2(y)+\cdots+h_k^2(y)+ux_n^2+x_nf_2(y)$. If there is $y_0$ s.t. $\Delta(y_0)=f_2^2(y_0)-4u(\sum_i h_i^2(y_0))>0$, then there are two distinct solutions in $x_n$, a contradiction. Thus $\Delta\leq 0$ -in particular $f\geq 0$-. If $\Delta(y)<0$, then no solution in $x_n$. If $\Delta(y)=0$, then, necessarily,  there is a double solution $x_n=0$, that is, $f_2(y)=0,h_i(y)=0$. 
Since $h_1(y)=\cdots=h_k(y)=0$ implies that $f_2(y)=0$, there is a vector $\Lambda=(\lambda_i)$ s.t. $f_2=\sum_i \lambda_ih_i$. Thus $(\sum_i\lambda_ih_i)^2\leq4u\sum_ih_i^2$, that is, $(<\Lambda,H>)^2\leq4u||H||^2$ and, more precisely: for every $H\not=0$, $(<\Lambda,H>)^2< 4u||H||^2$. Since the affine functions $(h_i)$ are linearly independent, the previous condition is equivalent to $||\Lambda||^2<4u$. 
Therefore $f(x)=h_1^2(y)+\cdots+h_k^2(y)+ux_n^2+x_n\sum_i\lambda_ih_i(y)=\sum_i (h_i(y)+(\lambda_i/2)x_n)^2+x_n^2(u-\sum_i\lambda_i^2/4)$ 
and we are done. $\square$
A: By the affine classification of quadrics (see, for instance, [ER, Chapter X.8] the surface $Q$ is affinely equivalent to one of the following quadrics $Q’$:
(1) $\pm x_1^2\pm x_2^2\pm \dots \pm x_r^2=1$ ($1\le r\le n$) 
(2) $\pm x_1^2\pm x_2^2\pm \dots \pm x_r^2=0$ ($1\le r\le n$)
(3) $\pm x_1^2\pm x_2^2\pm \dots \pm x_r^2-2x_n=0$ ($1\le r\le n-1$)
The corresponding affine map transforms $H$ to a hyperplane $H’$ determined by an equation
(4) $a_1x_1+a_2x_2+\dots +a_nx_n=b$ or $(a,x)=b,$
where $a=(a_1,\dots, a_n)\ne 0$ and $(\cdot,\cdot)$ denotes the inner product.
It remains assuming $Q’\subset H’$ to fulfill a simple but a bit long case check.
If the considered case is fixed, by $I^+$ (resp. $I^-$, $I^0$) we denote the set of indices $i$ such that the coefficient in the monomial of the variable $x_i$ in the equation is positive (resp. negative, zero). Also for each $1\le i\le n$ let $e_i$ denotes the standard $i$-th ort in $\Bbb R^n$, that is the vector whose all coordinates are zeroes except $i$-th, which is $1$. 
(1) Since $a\ne 0$, there exists $a_i\ne 0$. 
Assume that $i\in I^+$. Then both points $e_i$ and $-e_i$ satisfy equality 1. So they both satisfy equality 4 and then $$b=(a,e_i)=(a,-e_i)=-(a,e_i)=a_i=0,$$ a contradiction.
Assume that the set $Q’$ is non-empty. This implies the set $I^+$ is non-empty. Pick any index $j\in I^+$. By the above, $a_j=0$. 
Assume that $i\in I^0$. Then a point $e_i+e_j$ satisfies equality 1. So it satisfies equality 4 and then $$b=(a, e_i+e_j)=a_i+a_j=a_i=0,$$ 
a contradiction.
Thus $i\in I^-$. Then a point $e_i+\sqrt{2}e_j$ satisfies equality 1. So it satisfies equality 4 and then $$b=(a, e_i+\sqrt{2}e_j)=a_i+\sqrt{2}a_j=a_i=0,$$ 
a contradiction. 
Therefore the set $Q’$ is empty.
(2) Since $a\ne 0$, there exists $a_i\ne 0$. 
Assume that $i\in I^0$. Then a point $\lambda e_i$ satisfies equality 2 for each real $\lambda$. Then $$b=(a,\lambda e_i)=\lambda a_i.$$
Since both $a_i$ and $b$ are constant, $a_i=b=0$, a contradiction. 
Thus without loss of generality we may assume that $i\in I^+$.  Assume that the set $I^-$ is non-empty. Pick an arbitrary index $j\in I^-$. Both points $e_1+e_i$ and $-(e_1+e_i)$ satisfy equality 2. So they both satisfy equality 4 and then $$b=(a,e_i+e_j)=(a,-(e_i+e_j))=-(a,e_i+e_j)=a_i+a_j=0.$$
But a point $e_1-e_i$ also satisfies equality 2 . So it satisfies equality 4 and then $$0=b=(a,e_i-e_j)=a_i-a_j.$$ Thus $a_i=a_j=0$, a contradiction. 
Therefore the set $I^-$ is empty and thus $$Q’=\{x: x_j=0\mbox{ for each } j\in I^+\}.$$ 
(3) Since $a\ne 0$, there exists $a_i\ne 0$. 
Assume that $i\in I^0$. Then a point $\lambda e_i$ satisfies equality 3 for each real $\lambda$. So it satisfies equality 4 and then $$b=(a,\lambda e_i)=\lambda a_i.$$
Since both $a_i$ and $b$ are constant, $a_i=b=0$, a contradiction. 
Assume that $i\in I^+\setminus\{n\}$. Then a point $2\lambda e_i+2\lambda^2 e_n$ satisfies equality 3 for each real $\lambda$. So it satisfies equality 4 and then $$b=(a, 2\lambda e_i+2\lambda^2 e_n)=2\lambda a_i+2\lambda^2 a_n.$$
Since $a_i$, $a_n$ and $b$ are constant, $a_i=a_n=b=0$, a contradiction.
Assume that $i\in I^-\setminus \{n\}$. Then a point $2\lambda e_i-2\lambda^2 e_n$ satisfies equality 3 for each real $\lambda$. So it satisfies equality 4 and then $$b=(a, 2\lambda e_i-2\lambda^2 e_n)=2\lambda a_i-2\lambda^2 a_n.$$
Since $a_i$, $a_n$ and $b$ are constant, $a_i=a_n=b=0$, a contradiction.
Finally, assume that $i=n$. If $1\in I^+$ then put $\varepsilon=1$, otherwise (that is, if  $1\in I^-$) put $\varepsilon=-1$. Then a point $2\lambda e_1+2\varepsilon \lambda^2 e_n$ satisfies equality 3 for each real $\lambda$. So it satisfies equality 4 and then $$b=(a, 2\lambda e_1+2\varepsilon\lambda^2 e_n)=2\lambda a_1+2\varepsilon\lambda^2 a_n.$$
Since $a_1$, $a_n$ and $b$ are constant, $a_1=a_n=b=0$, a contradiction.
Thus case 3 cannot hold. 
References
[ER] N.V. Efimov, E.R. Rozendorn, Linear algebra and high-dimensional geometry (in Russian)
