I'm reading "Sets, Models and Proofs" by I. Moerdijk and J. van Oosten to have some basic understanding of set theory.
The last step in "Hartogs' Lemma" proof is a headache: "This is impossible however, since $[(Y_f ,\leq)]$ is an element of $P/\mathord{\cong}$ ". I don't understand where is the contradiction.
Update after Asaf's reply.
Below is my visualization of the concepts in the proof's last paragrpah.
$X$ is the original set; $P=\{(L,\leq) \mid L\subset X, \leq \text{ well-orders } L\}$ ; the vertical axis in $P$ is what I imagine as the $\cong$-equivalent dimension; so the horizontal dimension is the $P/\cong$, with $\leq$ defined based on $\preceq$; $f$ is the bijection between $P/\cong$ and $Y_f\subset X$; $\leq_{Y_f}$ can be induced on $Y_f$ based on $\leq$ defined on $P/\cong$; $(Y_f, \leq)$ is an element in $P$; $[(Y_f, \leq)]$ is an element in $P/\cong$.
So far so good... where is the contradiction?
Below is quoted from "Sets, Models and Proofs":
Lemma 1.4.1 (Hartogs’ Lemma) For every set $X$ there is a well-ordering $(L_X,\leq)$ such that there is no injective function from $L_X$ to $X$.
Proof. Let $P$ be the set of all pairs $(L,\leq)$ where $L$ is a subset of $X$ and $\leq$ is a well-ordering on $L$. We shall denote the pair $(L,\leq)$ simply by $L$.
For two such $L$ and $M$, we write $L\preceq M$ if there is a (necessarily unique, by Proposition 1.3.7) embedding of well-ordered sets: $L\rightarrow M$. Note:
- we have both $L\preceq M$ and $M\preceq L$, if and only if $L \cong M$;
- if $L \cong L′$ and $M\cong M′$, then $L\preceq M$ if and only if $L′\preceq M′$.
We can therefore define an order relation $\leq$ on the set $P/\mathord{\cong}$ of equivalence classes of $P$ modulo the equivalence relation $\cong$. By Proposition 1.3.9, the set $P/\mathord{\cong}$ is a linear order with the relation $\leq$.
Note, that if $L \prec M$ (that is, $L\preceq M$ but $M \ncong L$), there is a unique $m \in M$ such that $L$ is isomorphic to the set $\downarrow(m) = \{m′ \in M \mid m′ < m\}$ with the restricted order from $M$.
Therefore, if we denote the $\cong$-equivalence class of $L$ by $[L]$, the set $$\{\alpha \in P/\mathord{\cong} \mid \alpha < [L]\}$$ is isomorphic to $L$.
Now suppose that $W \subseteq P/\mathord{\cong}$ is a nonempty set of $\cong$-equivalence classes. Let $\alpha = [L]$ be an arbitrary element of $W$. Consider the set $$L_W = \{l \in L\mid [\downarrow(l)] \in W\}$$
If $L_W$ is empty, clearly $[L]$ is the least element of $W$. If $L_W$ is nonempty, then it has (as subset of the well-ordered set $L$) a least element $l_W$. But then $[\downarrow(l_W)]$ is the least element of $W$. So every nonempty subset of $P/ \mathord{\cong}$ has a least element, and therefore $P/\mathord{\cong}$ is a well-ordered set.
There cannot be an injective function from $P/\mathord{\cong}$ into $X$, for suppose $f$ is such a function. Then $f$ gives a bijective function between $P/\mathord{\cong}$ and a subset $Y_f$ of $X$; we can then give $Y_f$ the same well-ordering as $P/\mathord{\cong}$, so we have $(Y_f ,\leq) \cong (P/\mathord{\cong},\leq)$. This is impossible however, since $[(Y_f ,\leq)]$ is an element of $P/\mathord{\cong}$ (see Proposition 1.3.7).
Lemma 1.3.7 There can be at most one embedding from one well-order $L$ into another well-order $M$. Therefore, if $L$ is a well-ordered set and $l \in L$, $L$ is never isomorphic to $\{l′ \in L| l′ < l\}$.

It's not true that a well-ordered set cannot be isomorphic to a proper subset of itself, but it is true that it cannot be isomorphic to a proper initial segment of itself.
If $P/\cong$ can be injected into $X$, then there is some equivalence class of $(Y,\leq_Y)$ which is in $P/\cong$ which is isomorphic to $P/\cong$, and this means that we have a well-ordered set which is isomorphic to a proper initial segment of itself. And that is a contradiction. The initial segment is all those elements strictly below the equivalence class of $(Y,\leq_Y)$.