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$.