Q:

Questions about the local ring of a point on a variety.

Let $Y$ be a variety. Let $\mathcal{O}_{P, Y} = \mathcal{O}_{P}$ be the ring of germs of regular functions on $Y$ near $P$. That is, an element of $\mathcal{O}_P$ is pair $\langle U, f \rangle$ where $U$ is an open subset of $Y$ containing $P$ and $f$ is a regular function on $U$. 
How to show that 
(1) $\mathcal{O}_P$ is a local ring (has only one maximal ideal $\mathfrak{m}$) and 
(2) $\mathcal{O}_{P}/\mathfrak{m} \cong k$? 
These questions comes from page 16 of the book Algebraic Geometry by Hartshorne.

Take $\mathfrak{m}=\{ f \in \mathcal{O}_P \mid f(P) = 0 \}$. Then $\mathfrak{m} \subseteq \mathcal{O}_P$. It is clear that $\mathfrak{m}$ is an ideal of $\mathcal{O}_P$. Suppose that $f(P) \neq 0$ and $f \in \mathcal{O}_P$. Then $1/f$ is regular in some neighborhood of $P$ and hence $1/f \in \mathcal{O}_P$. How could we show that $1/f \in \mathfrak{m}$? I think that if $1/f \in \mathfrak{m}$, then $1=f \cdot 1/f \in \mathfrak{m}$ and hence $\mathfrak{m} = \mathcal{O}_P$. Is this true? Thank you very much.
Edit: I made a mistake. I should consider the ideal $\mathfrak{n}$ such that $\mathfrak{m} \subsetneq \mathfrak{n} \subseteq \mathcal{O}_P$ and show that $\mathfrak{n} = \mathcal{O}_P$.

A:

Define a map $\varphi : \mathcal{O}_P \to k$ that sends a regular function $f$ at $P$ to $f(P) \in k$. This is just the evaluation homomorphism and clearly $\mathfrak{m} = \ker \varphi$. Now this map is also surjective because for any element $a \in k$ I can just define the constant function on $Y$ that sends every $y \in Y$ to $a$. Such a function is clearly regular at $P$. Thus it follows that
$$\overline{\varphi} : \mathcal{O}_P/\mathfrak{m} \stackrel{\cong}{\longrightarrow} k$$
is an isomorphism. 

