Let $X,Y$ be locally Noetherian schemes. Let $f:X\to Y$ be a finite, surjective, and locally complete intersection morphism, i.e., locally it can be decomposed as regular immersion followed by a smooth morphism. Recall: an immersion $X\to Y$ is called a regular immersion at a point $x$ if $\mathcal{O}_{X,x}$ is isomorphic as $\mathcal{O}_{Y,y}$-module to $\mathcal{O}_{Y,y}$ modulo an ideal $I$ generated by a regular sequence of elements of $\mathcal{O}_{Y,y}$.
Question: prove that $f$ is flat. In particular, $f$ will be a simultaneously open and closed morphism.