Singular points of orders of a number field Let $K$ be a number field (finite field extension of $\mathbb{Q}$) and let $\mathcal{O}_{K}$ be its ring of integers (integral closure of $\mathbb{Z}$ in $K$). We know that $\mathcal{O}_{K}$ is a free $\mathbb{Z}$-module of rank $n=[K:\mathbb{Q}]$, and we know that it is a Dedekind domain. Hence $\operatorname{Spec}(\mathcal{O}_{K})$ is a regular curve.
Let $\beta_{1},\ldots,\beta_{n}\in \mathcal{O}_{K}$ be a basis of $K$ over $\mathbb{Q}$. Then $\mathcal{O}=\mathbb{Z}[\beta_{1},\ldots,\beta_{n}]\subseteq \mathcal{O}_{K}$ is by definition an order of $K$ [Remark (thanks to Hurkyl): we really want the $\beta_{i}$ to be a basis of $\mathcal{O}$ as a free $\mathbb{Z}$-module, see the comments below]. We also know that orders of $K$ are one-dimensional noetherian domains. So the only thing that stops $\mathcal{O}$ from being a Dedekind domain (and hence being equal to the maximal order $\mathcal{O}_{K}$) is that $\mathcal{O}$ may not be integrally closed. This means that $\operatorname{Spec}(\mathcal{O})$ is a curve which may have a bunch of singular points, and $\mathcal{O}=\mathcal{O}_{K}$ if and only if $\operatorname{Spec}(\mathcal{O})$ is a regular curve (we go from $\operatorname{Spec}(\mathcal{O})$ to $\operatorname{Spec}(\mathcal{O}_{K})$ by normalizing).
We want to determine whether $\mathcal{O}=\mathcal{O}_{K}$ or not, and for this we have the following proposition:

Equality holds if and only if for every prime $p$ such that
  $$ p^{2} | \operatorname{disc}(\beta_{1},\ldots,\beta_{n})=\det(\operatorname{Tr}_{K/\mathbb{Q}}(\beta_{i}\beta_{j}))$$
  we have that $\bar{\beta_{1}},\ldots,\bar{\beta_{n}}\in \mathcal{O}_{K}/p\mathcal{O}_{K}$ are linearly independent over $\mathbb{F}_{p}$.

Given the previous geometric interpretation, I was hoping that what this proposition really does is "looking for singularities" in the curve $\operatorname{Spec}(\mathcal{O})$. So I tried to show that if the projections of the $\beta_{i}$ are linearly dependent over $\mathbb{F}_{p}$, then there is a prime $\mathfrak{p}$ above $p$ in $\mathcal{O}_{K}$ such that the localization $\mathcal{O}_{K,\mathfrak{p}}$ is not a discrete valuation ring. But I don't really see how to relate both things, and the proof of the proposition also doesn't help me see any connection. Any hints? And in particular is there any geometric interpretation of this proposition, say, in terms of Zariski (co)tangent spaces?
Sketch the proof I know, in case it helps:
We know an integral basis exists, so we may write our basis in terms of this integral basis. Since the discriminant of our basis is the discriminant of the integral basis times the square of the determinant of the transition matrix, equality holds if and only if the determinant of the transition matrix is plus or minus one.
So if our basis is not an integral basis, some prime $p$ divides the determinant of the transition matrix (which implies that its square divides the discriminant of our basis). This means that the reduction modulo $p$ of the matrix has non-trivial kernel, and then any non-trivial element in the kernel gives us a non-trivial linear combination of the $\bar{\beta_{i}}$ which is equal to zero. So the $\bar{\beta_{i}}$ are not linearly independent over $\mathbb{F}_{p}$.
Conversely, suppose there exists a $p$ such that we can find a non-trivial linear combination of the $\bar{\beta_{i}}$ equal to zero, hence a non-trivial element in the kernel of the reduction modulo $p$ of the transition matrix. Then the determinant of the transition matrix is divisible by $p$, and hence our basis is not an integral basis.
 A: This is not an entirely complete proof but I think the ideas can transformed to a rigorous proof.
So the inclusion of $\mathbb{Z}$ to your order $\mathcal{O}$ gives a finite surjective map $\textrm{Spec}(\mathcal{O})\to\textrm{Spec}(\mathbb{Z})$. I want to think about it as a branched covering map $X\to Y$ of curves. In the geometric situation, a singularity of $X$ is always among the ramification points (and I expect this to be true in our situation as well). So in order to check whether $X$ is nonsingular, we can restrict to the finitely many ramification points. This is one thing that your proposition does since the ramification points are precisely the points where the trace bilinear form is degenerate. What it does after that is not quite looking at tangent spaces but rather looking at their push-forwards to $\textrm{Spec}(\mathbb{Z})$.
Lets look at the map $\textrm{Spec}(\mathcal{O}_K)\to\textrm{Spec}(\mathcal{O})$ which is the normalization. Being a nonsingular point of $\textrm{Spec}(\mathcal{O})$ is equivalent to this map being locally an isomorphism. Checking this requires checking whether the two $\mathbb{Z}_p$-modules, that you get from localizing your orders, are the same. Now applying Nakayama's Lemma restricts this to the criterion from your proposition.
In particular, this answers one of your initial questions. Namely, we see that if these $\beta_i$ are linearly dependent over $\mathbb{F}_p$, then there is a singular point above $p$ in $\mathcal{O}$ and vice versa.
