Me again, sorry for keep spamming with Hartshorne post. But for sure I think questions like this can facilitate other's learning.
I am fine with the proof above the red line. What I would like to ask is some details on the parts underlined in green.
I understand how we obtain the ideal sheaf $\mathscr{I}'$, but I am not sure why there is a "corresponding closed subscheme".
It appears to me that the structure of Theorem 8.17 is as follows: Assume $Y$ is irreducible and some other conditions, then "$Y$ is singular" iff "condition (1)+(2) are satisfied". Now in the second underline, it seems to me it means conditions (1)+(2) will implies non-singularity together with irreducibility, which is an assumption statement.
First of all, I cannot see explicitly why $Y\subseteq Y'$ and I cannot find any reference to the fact that both scheme being integral, irreducible will lead to the fact that $Y=Y'$ and $\mathscr{I}=\mathscr{I}'$.
Thank you very much in advance.

Any quasicoherent sheaf of ideals $\mathcal{I}\subset \mathcal{O}_X$ determines a closed subscheme by taking $\mathcal{O}_X/\mathcal{I}$ as the structure sheaf of the support of $\mathcal{O}_X/\mathcal{I}$. This is just the globalization of the construction that gives you the closed subscheme of $\operatorname{Spec} A$ associated to an ideal $I\subset A$.
There shouldn't be a problem here - sometimes you get one of your assumptions back for free in a proof.
The claim about dimension here is the important part. Any proper closed subscheme of an integral scheme is of codimension at least one, so $Y'\subset Y$ closed with equality of dimensions and $Y$ integral means that $Y'=Y$. From here, the equality of ideal sheaves follows since they're constructed on the same closed subscheme.