Let me introduce some definitions first in order for our discussion. A Riemannian metric on a smooth manifold $M$ is a smooth symmetric $2$-tensor field $g$ on $M$ that is positive-definite at each point of $M$. By the positive-definiteness of $g$ at $p\in M$, we mean that for each nonzero $v\in T_p M$, $g_p(v,v)>0$. On the other hand, a pseudo-Riemannian metric on $M$ is a smooth symmetric $2$-tensor field $q$ whose value at each point is non-degenerate with the same signature. We say that $q$ is non-degenerate at $p\in M$ if for each nonzero $v\in T_p M$, $\exists w\in T_p M$ s.t. $q_p(v,w)\neq 0$. The term "signature" here denotes the invariant (w.r.t. the diagonalizing basis chosen) pair $(r,s)$ in any diagonal representation of $q_p$ with $r$ positive diagonal entries and $s$ negative diagonal entries.
Let $g$ be a Riemannian metric on $M$. To prove $g$ is a pseudo-Riemannian metric, we must prove that $\forall p\in M$,
(1) $g_p$ is non-degenerate.
(2) $g_p$ has the same signature.
The proof of (1) is not too hard and be attained by invoking the positive-definiteness of $g$. But I have no idea how to prove (2). Sylvester's law of inertia only guarantees us to talk about the signature of $g$ at a point, and it doesn't tell us that the signature of $g$ is the same throughout the whole manifold. Why's that? Thank you.