Extension of prime ideal in $k[V]$ to $\mathcal{O}_P(V)$ is prime? Let $k$ be an algebraically closed field, $I\subset k[X_1,\cdots, X_n]$ be a prime ideal, $V=V(I) \subset \mathbb{A}^n$  a variety and $P=(a_1,\cdots, a_n)\in V.$ Recall that $\mathcal{O}_P(V)$ is the set of rational functions from $V$ to $k$ defined at $P.$
Suppose $J\subset k[V]$ is a prime ideal of the coordinate ring $k[V] = \dfrac{k[X_1,\cdots, X_n]}{I}$ and that $J$ is contained in the maximal ideal $ \dfrac{ (X_1-a_1, \cdots, X_n-a_n)}{I}$.
I want to show that $J' := J\mathcal{O}_P(V)$ is a prime ideal of $\mathcal{O}_P(V).$

Here is my attempt: Let $r_1, r_2 \in \mathcal{O}_P(V)$ and write $r_i = \dfrac{p_i}{q_i}$ where $p_i, q_i \in k[V]$ (this form is unique up to associates since $k[V]$ is a UFD).
Suppose $\dfrac{p_1p_2}{q_1q_2} \in J'.$ The $q_i$ are defined at $P$ so $q_1q_2\in \mathcal{O}_P(V)$ so $p_1p_2\in J'.$ 
Now these $p_1,p_2$ are in $k[V].$ I think I want to use the primality of $J$ to get that $p_1$ or $p_2$ is in $J'$ from which I can conclude that $J'$ is prime. But how do I get $p_1\in J'$ or $p_2\in J'$? This approach may be totally wrong, I can't see where $J$ being contained in the maximal ideal that corresponds to $P\in V$ is used. 
Any help is appreciated. Thank you.
 A: The condition that $J$ is contained in the maximal ideal corresponding to $P$ ensures that $J':=J \mathcal{O}_P(V)$ is not all of $\mathcal{O}_P(V)$. This is a necessary condition for $J'$ to be a prime ideal, since $\mathcal{O}_P(V)$ is not considered a prime ideal of itself.
Also, it is not true that $k[V]$ is always a UFD (consider for example $V=V(xy-zw) \subset \Bbb{A}^4$).
But basically, your attempt at solving the problem is correct. Assume that
$$
\frac{p_1}{q_1} \cdot \frac{p_2}{q_2} \in J'.
$$
Multiplying by $q_1q_2$, and using that $J'$ is an ideal of $\mathcal{O}_P(V)$ yields that $p_1p_2 \in J'$. But $p_1p_2 \in J$ by the definition of $J'$ (see edit below), hence $p_1 \in J$ or $p_2 \in J$, since $J$ is prime. This shows that $\frac{p_1}{q_1} \in J'$ or $\frac{p_2}{q_2} \in J'$.
EDIT:
You are right, this step is not completely immediate. Thanks for pointing that out.
Assume that 
$$
\frac{p_1p_2}{q_1q_2}=\frac{p}{q_1q_2} \cdot r
$$
with $p \in J$, $r \in \mathcal{O}_P(V)$. Write $r=\frac{f}{g}$ with $f,g \in k[V]$, $g(P) \neq 0$. Then
$$
\frac{p_1p_2}{q_1q_2}=\frac{p'}{q}
$$
where $p':=p \cdot f \in J$ and $q:=q_1q_2 \cdot g$.
Now the above equality implies that $p_1p_2 \cdot q=p' \cdot q_1q_2$ in $k[V]$. The right hand side is contained in $J$, hence so is the left hand side. Now $J$ is a prime ideal, therefore $p_1p_2 \in J$, or $q \in J$. But the latter is impossible, because $q \notin (X_1-a_1,...,X_n-a_n)/I \supset J$. Thus we must have $p_1p_2 \in J$.
