If Y is a closed set, e.g. when Y is a variety, one can select g and h from the coordinate ring. Changing either function by something that vanishes on Y isn't going to matter.
A map f on a projective variety is regular at p if g and h are homogenious and of the same degree, so that the quotient is well defined on projective space. This quotient must equal f on Up. Once again, if Y is closed, we can add any function that vanishes on Y to g or h without changing g/h, hence g and h can be drawn from the coordinate ring. But remember, since Y is projective, g, or h, on its own, is not a well defined function on Y.
Perform a similar calculation for f1*f2. Again, the homogeneous degree is d1+d2 in projective space.
Finally, the quotient is also regular, provided g2 is nonzero throughout U.
It is enough to prove the preimage of every point is closed. Let v be a point in K. Find a neighborhood U for each point p in Y that satisfies the definition of regular at p. These neighborhoods cover Y, and Y is compact, so restrict attention to a finite subcover. If the preimage of v is closed in each Up, then the finite union of these preimages is closed, f is continuous at v, and f is continuous.
Concentrate on one of these open sets, say U1. Find polynomials g and h such that f = g/h on U1. Let q = g-v*h. If Y is projective, q is homogeneous. Within U1, q is 0 precisely when f equals v. This (along with Y′) is the beginning of an algebraic set that defines the preimage of v in Y. But q might be 0 in strange places outside of U1. Intersect q′ with the closed complements of the other open sets Up that cover Y. The result is a closed set equal to the preimage of v that lies in U1, but in none of the other open sets Up. Do this for U1 U2 U3 etc, and take the union. This is still closed, and it represents the points in the preimage of v that lie in exactly one of our open sets Up.
What if a point lies in the preimage of v, and is in both U1 and U2? build q1 based on U1, and q2 based on U2. If a point is in either U1 or U2, and satisfies both q1 and q2, then it is a preimage of v. conversely, a preimage of v in U1∩U2 will satisfy q1 and q2. Intersect with the complements of U3, U4, U5, etc, and we are indeed trapped within U1 and U2. This is now a subset of the preimage of v that includes the entire preimage of v within U1∩U2 and no other Up. Do this for each pair of open sets Ui∩Uj, and take the union.
Do the same for triples, and fourples, and so on. The union over everything is closed, and covers the entire preimage of v. Therefore f is continuous from Y into K.
this works even if Y is a quasi variety, and f is not regular on the entire variety.
Suppose two regular maps agree on U, but differ somewhere else. Subtract to find a map f that is 0 on U and nonzero somewhere else. Remember that f is regular and continuous. Since 0 is closed in K, some open set O in Y has nonzero image in K. Since Y is irreducible, O and U intersect. This is a contradiction, hence f(Y) = 0, and the two original functions agree.
This works for a quasi variety, since it too is irreducible.
Let T be an open ball in K, let q be a point in T, and let p be a preimage of q. find U containing p so that f = g/h on U. Remember that U is also open in the metric topology. The function g/h is defined wherever h is nonzero. This is an open set in zariski space and in the metric space. Thus g/h is continuous on an open set that contains U. Let S be the preimage of T under g/h. Now S is an open set in an open set, which is thus open. also, S contains p. Restrict U to U intersect S. Now f(U) lies entirely inside T. Do this for each q in T, and each f(p) → q, and the preimage of T is open. Therefore f is continuous, even differentiable, in the traditional sense.