  Let $R$ be a standard graded algebra over a field. We investigate how the
singularities of $R$ affect its $h$-vector, which is the coefficients of the
numerator of its Hilbert series. The most concrete consequences of our work
asserts that if $R$ satisfies Serre's condition $(S_r)$ and have reasonable
singularities (Du Bois on the punctured spectrum or $F$-pure), then $h_0,\dots,
h_r\geq 0$. Furthermore the multiplicity of $R$ is at least
$h_0+h_1+\dots+h_{r-1}$. We also prove that equality in many cases forces $R$
to be Cohen-Macaulay. The main technical tools are sharp bounds on regularity
of certain Ext modules, which can be viewed as Kodaira-type vanishing
statements for Du Bois and $F$-singularities. Many corollaries are deduced, for
instance that nice singularities of small codimension must be Cohen-Macaulay.
Our results build on and extend previous work by de Fernex-Ein, Eisenbud-Goto,
Huneke-Smith, Murai-Terai and others.
