Surjective closed morphism of schemes induces inequality of dimensions 
Let $f: Y\to X$ be a surjective closed morphism of schemes. Prove
  $\dim Y\geq \dim X$.

I was made to believe that this should be easy, but I somehow did not manage to prove this. Using the fact that $f$ is closed and surjective, it is easy to reduce this to the case where both $X$ and $Y$ are irreducible. Now, if both were (locally) of finite type over a field, then the inequality would follow from the fact that the morphism induces an extension of the function fields. In the general case, however, I did not manage to produce a proof.
Clearly it would be enough to prove the following lemma:

Let $f:Y\to X$ be a closed morphism of schemes. Then for any $y\in Y$ and any generization $x_0$ of $x=f(y)$ there is a generization $y_0$ of $y$ with $f(y_0)=x_0$.

This lemma is true in the case where $f$ is an open morphism, but I don't know whether it is true in the closed case as well. At any rate, I also failed to prove this so far.
Any input on this problem would be highly appreciated, especially as I suspect that I am making things unneccessarily complicated right now.
 A: By the reduction claimed in your post, we may reduce the general case to the case where $X,Y$ are both irreducible. From here, we induct on $\dim X = n$. The case of $n=0$ is trivial. For the induction step, let $X_0\subset X_1\subset \cdots \subset X_n \subset X_{n+1} = X$ be a chain of proper inclusions of irreducible closed subsets of maximal length inside $X$. By definition of this chain, each $X_i$ is of dimension $i$. Then $f^{-1}(X_n)$ is a closed subset of $Y$, and as the restriction of closed and surjective maps is again closed and surjective, we may apply the induction hypothesis to see that $\dim f^{-1}(X_n)$ has dimension at least $n$. But $f^{-1}(X_n)$ is a proper closed subset of $Y$, and since $f^{-1}(X_n)$ is dimension at least $n$, it has an irreducible component of dimension at least $n$, which is properly contained in the irreducible set $Y$. Thus $\dim Y \geq n+1$, and we have proven the claim.

An alternate approach proceeds from the concept of specialization. In a topological space $X$, we say that $x$ is a specialization of $x'$ if $x\in\overline{\{x'\}}$ and denote this $x'\leadsto x$. The key fact for us is that for a scheme (more generally, any sober space) a specialization $x'\leadsto x$ is equivalent to an inclusion of irreducible closed subspaces $\overline{\{x'\}}\supset \overline{\{x\}}$ since every irreducible closed subset has a unique generic point. This means that we can calculate the dimension as the length of the longest chain of nontrivial specializations.
Now let's do something with specializations. Given a continuous map of topological spaces $f:Y\to X$, we say specializations lift along $f$ if given $x'\leadsto x$ in $X$ and any $y'\in Y$ with $f(y')=x'$, there exists a specialization $y'\leadsto y$ with $f(y)=x$. I claim that if $f$ is a closed map, then specializations lift along $f$: if $x'\leadsto x$ is a specialization and $f(y')=x'$, then $f(\overline{\{y'\}})$ is a closed subset containing $x'$, so it also contains $x$ and therefore there is some $y\in \overline{\{y'\}}$ with $f(y)=x$.
This now gives our result. For any chain of nontrivial specializations $x'\leadsto \cdots\leadsto x$ in $X$, we have that there is some $y'\mapsto x$ by surjectivity, and then since specializations lift along $f$, we get a corresponding chain of nontrivial specializations $y'\leadsto\cdots\leadsto y$ in $Y$, so $\dim Y\geq \dim X$.
A: EEDIT: The accepted answer has been edited and it looks pretty good now. If that answer is completely clear to you, then there is no need for you to read anything below.
For what is mentioned as the point-irreducible closed subset correspondence below (which is also mentioned as "the key fact" above in the accepted answer), I mean the following proposition in Görtz & Wedhorn, Algebraic Geometry I.

Proposition 3.23. Let $X$ be a scheme. The mapping
$$ X\to \{Z\subset X ; Z \text{ is closed and irreducible}\}:x\mapsto \overline{\{x\}}$$
is a bijection, i.e. every irreducible closed subset contains a unique generic point.


EDIT:
For what is below, let $f:X\to Y$ be a closed surjective morphism (sorry to reverse the $X$ and $Y$, but the version of the problem I met is in this notation).
I just noticed that one can reduce to the case where both $X$ and $Y$ are irreducible using the point-irreducible closed subset correspondence: it suffices to show for each irreducible subset $\overline{\{y’\}}=Y’\subset Y$ that $\dim f^{-1}(Y’)\geq \dim Y’ $, and by choosing $x’\in X$ such that $f(x’)=y’$ we need only show $\dim\overline{\{ x’\}}\geq \dim \overline{\{y’\}}$. It is now that the case where $\dim X=0$ becomes trivial, and the induction step in the first paragraph of the accepted answer works through. Anyway, I shall post this answer here as a complement.

There is a gap in the currently accepted answer , which I and everyone I can ask failed to figure out how to fix (EEDIT: the gap has been removed), so I decide to post this answer, despite that this question is already three-year old. The instructor of mine told me the following solution.
Let $Y_0\subsetneq \cdots\subsetneq Y_n$ be any chain of irreducible closed subsets of $Y$, the claim is that there exists a chain of irreducible closed subsets of $X$, $X_0\subsetneqq\cdots\subsetneq X_n$, such that $f(X_i)=Y_i$ for each $i$.
Since irreducible closed subsets of schemes are corresponded bijectively to the closures of single point, there is $Y_i=\overline{\{y_i\}}$ for some $y_i\in Y$ for each $i$. Since $f$ is closed, there is $f(\overline{\{x\}})=\overline{\{f(x)\}}$ for any $x\in X$ ($f(\overline{\{x\}})\supset\overline{\{f(x)\}}$ is clear by closeness of $f$; note that $x\in f^{-1}(\overline{\{f(x)\}})$, $\overline{\{x\}}\subset f^{-1}(\overline{\{f(x)\}}) $, hence the converse is also clear).
Now choose by surjectivity $x_n\in X$ such that $f(x_n)=y_n$, it suffices to find inductively that given $x_i\in X$ such that $f(x_i)=y_i$ (consequentially $f(\overline{\{x_i\}})=Y_i$), $x_{i-1}\in \overline{\{x_i\}}$ such that $f(x_{i-1})=y_{i-1}$, which implies that $f(\overline{\{x_{i-1}\}})=Y_{i-1}$ and hence $\overline{\{x_{i-1}\}}\subsetneq \overline{\{x_i\}} $ by surjectivity of $f$. Since $y_{i-1}\in \overline{\{y_i\}}=f(\overline{\{x_i\}})$, clearly such $x_{i-1}$ exists, so we are done.
This solution is based on the key fact that an irreducible closed subset of scheme is exactly the closure of a point. I don’t believe this statement is correct for general topological spaces since the irreducible component could have wild behavior, but I haven’t come up with a counterexample yet.
