I saw a claim that states for a field $k$ and an irreducible of finite type $k$ scheme $X$, $\textrm{dim}X=\textrm{dim} \mathcal{O}_{X,x}$ for any closed point $x$.
The proof starts with reducing the case $X$ is integral affine scheme, but I cannot understand how can we reduce the case. Is there any good idea?