Let $Y$ be a closed subscheme of a scheme $X$ and let $i:Y \rightarrow X$ be the inclusion morphism. Then the ideal sheaf of $Y$ is defined to be the kernel of the morphism of sheafs $i^{\#}: \mathcal{O}_X \rightarrow i_* \mathcal{O}_Y$ (Hartshorne p.115). My question is: why is the ideal sheaf defined for a closed subscheme, and not more generally, i.e. for any morphism of schemes $f:Y \rightarrow X$ as the kernel of the morphism of sheafs $f^{\#}: \mathcal{O}_X \rightarrow f_* \mathcal{O}_Y$?
[Math] Definition of the Ideal Sheaf
algebraic-geometrydefinition
Related Solutions
Ok, so first of all I'm just learning this stuff so I'm kind of shaky. If anyone has any comments for me or notices any errors please point them out. As far as I understand there are many different choices for ideal sheaf on $Y$ and they correspond to different subscheme structures. Since Hartshorne does not specify a choice of subscheme structure, I think we can make our own choice (since he only uses the existence of such a SES to derive something unrelated to the subscheme structure) and think of the ideal sheaf of $Y$ as the collection of sections of $\mathcal O_X$ that are not invertible at the stalks of elements of $Y$. We also should make the same choice for the ideal sheaf of $Y\cup\{p\}$.
With this choice in mind it is clear that on the complement of $p$, which is open since $p$ is a closed point, the ideal sheaves agree. Since the skyscraper sheaf is zero here, we have exactness. Thus we only need exactness at the stalk at $p$. Looking at the complement of $Y$ we reduce to the case where we have an affine scheme $U$ and our ideal sheaf on a closed point $p$ injecting into the sheaf of regular functions:
$$0\to I_p\to \mathcal O_U\to k(p)\to 0$$
But by our choice of ideal sheaf, $I_p$ is just the maximal ideal corresponding to $p$. This shows exactness on stalks at $p$.
The answer to your first two questions is yes, For the last question I think it is important to understand the affine case first, the general case is just using sheaf language to glue these affine cases.
In the affine case when you have an ideal $J$ you can naturally define a close subset $V(J)=\{P|J\subset P\}$ which as a topological space is equal to $Spec A/J$ It is also equal to the support of the A-module $A/J$ which by definition is the set of prime ideals $P$ such that $(A/J)_P\not =0$ if you write definition you see that this is equivalent to the condition $J\subset P$.
So it is natural to call the map $Spec\, A/J\to Spec\, A$ a closed immersion and it has all good properties you want, then using the sheaf language you can state the general case just replace $A$ by $O_X$ and ideal $J$ by a sheaf of ideals, and if you want to prove something you can reduce to the case of affines, for example, to compute the support you can choose an affine cover and compute the support locally.
Best Answer
A closed subscheme of $X$ corresponds to a closed subspace $|Y|$ together with a quasicoherent sheaf of ideals $\mathcal I_Y$ of $\mathcal O_X.$ In this situation, the sheaf of ideals is naturally identified as the kernel of the sheaf morphism $\mathcal O_X\to f_*\mathcal O_Y\cong\mathcal O_X/\mathcal I_Y.$
More generally, any morphism of schemes $f:Y\to X$ comes with a sheaf morphism $f^\sharp:\mathcal O_X\to f_*\mathcal O_Y,$ but this need not be surjective, and the geometric meaning of the kernel may not be obvious (we are now considering $\operatorname{Ann}(f_*\mathcal O_Y)$). For a very simple example, consider the structure morphism $f:\mathbb A^1_k\to\operatorname{Spec}(k)$ induced by $f^\sharp:k\to k[x]$ over a field $k.$ The sheaf morphism $f^\sharp$ has trivial kernel, so the corresponding closed subscheme is $\operatorname{Spec}(k)$ which corresponds to the support of $k[x]$ as an $\mathcal O_{\operatorname{Spec}(k)}$-module.
Have a look at Hartshorne Exercise II.5.6 for more details.