I want to post a message to say, after applying Hoot's answer, you're still 'not done yet' (this problem is quite technical).
Let's recall the situation. You can reduce to $f:X\rightarrow Y=\operatorname{Spec} B$ dominant morphism of integral schemes of finite type (we no longer need the generically finite assumption) inducing a finite extension $K(Y)\rightarrow K(X)$. This means that $X$ is covered by $U_i=\operatorname{Spec} A_i$ open such that $B\rightarrow A_i$ is finitely generated, and $A_i$ is generated by elements algebraic over $B$ as Hoot said. Note that in fact $B\hookrightarrow A_i$ is mono ($\forall i$) since $U_i$ is dense in $X$ since $X$ irred., and $f$ is dominant, so $U_i$ is dense in $Y$. Let $x_{ij}$ generate $A_i$ over $B$. Then $x_{ij}$ satisfies an equation of algebraic dependence over $B$ with leading coefficient $b_{ij}$. Put $U=\{b_{ij}\}_{i,j}$; then $W:=\operatorname{Spec} B[U^{-1}]$ is an open affine subset of $Y$ and again since $U_i\rightarrow Y$ is dense, $f^{-1}(W)\cap U_i\ne\emptyset\forall i$. Moreover, now $B[U^{-1}]\hookrightarrow A_i[U^{-1}]$ has $A_i[U^{-1}]$ finitely generated by integral elements; hence is finite over $B[U^{-1}]$.
We have reduced to $f : X\rightarrow Y=\operatorname{Spec} B$ with $U_i=\operatorname{Spec} A_i$ covering $X$ and $B\hookrightarrow A_i$ finite. But we need to find a nonempty open subset $V\subset Y$ such that $f:f^{-1}(V)\rightarrow V$ is finite (in particular, affine). Put $W:=\bigcap U_i$ (nonempty open since $X$ irred.). Let $\mathfrak a_i\subset A_i$ be such that $U_i\supset V(\mathfrak a_i)=U_i-W$. $B\subset A_i$ are integral domains, and $K(A_i)$ is algebraic over $K(B)$. It is then a fact that every nonzero ideal of $A_i$ intersects $B$ nontrivially. $\mathfrak a_i$ is nonzero since $W\ne\emptyset$. Hence $\exists f_i\in B\subset A_i$ such that $D(f_i)\subset W\subset U_i$. Put $U:=\{f_i\}_i$. Then $V:=\operatorname{Spec} B[U^{-1}]$ is nonempty affine open in $Y$ and so $\emptyset\ne f^{-1}(V)\subset W$. Note that $f^{-1}(V)$ coincides with $\bigcap_i X_{f_i}$, where $f_i$ is the image of $f_i$ in $\Gamma(X,\mathscr O_X)$ ($B$ injects into global sxns since $f$ dominant). Moreover $f^{-1}(V)\subset W$ hence coincides with $\bigcap_i X_{f_i}\cap U_j=\bigcap_i D(f_i)\cap U_j\forall j=\operatorname{Spec} A_j[U^{-1}]$, where as always we identify $B$ with its image as appropriate. Hence $f:f^{-1}(V)\rightarrow V$ is our desired finite morphism.
One last thing: here is a different (probably functionally equivalent) way to prove that $K(X)$ is a finite extension of $K(Y)$. Reduce to $f:\operatorname{Spec} A=X\rightarrow Y=\operatorname{Spec} B$ dominant generically finite morphism of integral affine schemes of finite type. Identifying $B$ with its monomorphic image we have $B\subset A$ domains with only finitely many primes of $A$ lying over $(0)\in\operatorname{Spec} B$. Replacing $B$ by $K(B)$ we have $A$ finitely generated over a field hence Noetherian and Jacobson (by the Nullstellensatz). A Noetherian ring $A$ is Jacobson iff $\forall\mathfrak p\in\operatorname{Spec} A$ of dimension one, $R/\mathfrak p$ has infinitely many ideals. $A$ has only finitely many ideals after replacing $B$ by $K(B)$, so all primes of $A$ must be maximal. Thus $A$ is Artinian (and Noetherian) hence finite over $K(B)$. Therefore $K(A)=K(X)$ is a finite extension of $K(B)=K(Y)$.
You are correct, the direct limit $\varinjlim\mathcal{O}_X(f^{-1}(V))$ is essentially given by $A\otimes_B B_{\phi^{-1}(P)}$ (once you shrink to affine opens containing $P$ and $f(P)$). Here's a proof.
First, observe that when $X$ and $Y$ are schemes, it suffices to understand the affine case. Choose an affine open neighborhood $\operatorname{Spec}(B)\subseteq Y$ of $f(P)$ and an affine open neighborhood $\operatorname{Spec}(A)\subseteq X$ of $P$ with $\operatorname{Spec}(A)\subseteq f^{-1}(\operatorname{Spec}(B)).$ Then we have $\mathcal{O}_{X,P} = \mathcal{O}_{\operatorname{Spec}(A),P}$ and $\mathcal{O}_{Y,f(P)} = \mathcal{O}_{\operatorname{Spec}(B),f(P)}.$
So, let us assume that $X = \operatorname{Spec}(A)$ and $Y = \operatorname{Spec}(B),$ and that $f : X\to Y$ comes from the morphism $\phi : B\to A$ of rings. Let $\mathfrak{p}\subseteq A$ be the prime ideal of $A$ corresponding to the point $P\in X,$ and let $\mathfrak{q} = \phi^{-1}(\mathfrak{p})$ be the prime ideal of $B$ corresponding to $f(P).$ Since distinguished opens $D(b)$ with $b\in B$ form a basis for the Zariski topology on $Y,$ we may compute the direct limit defining the stalk as
\begin{align*}
\varinjlim_{D(b)\ni f(P)} \mathcal{O}_{\operatorname{Spec}(B)}(D(b)) &\cong \varinjlim_{b\not\in\mathfrak{q}} B[b^{-1}]\\
&\cong B_\mathfrak{q}.
\end{align*}
Now, the direct limit we want to compute is
$$
\varinjlim_{D(b)\ni f(P)}\mathcal{O}_{\operatorname{Spec}(A)}(f^{-1}(D(b))).
$$
We have $f^{-1}(D(b)) = D(\phi(b)),$ so this simplifies as
\begin{align*}
\varinjlim_{D(b)\ni f(P)}\mathcal{O}_{\operatorname{Spec}(A)}(f^{-1}(D(b))) &= \varinjlim_{b\not\in\mathfrak{q}}\mathcal{O}_{\operatorname{Spec}(A)}(D(\phi(b)))\\
&\cong \varinjlim_{b\not\in\mathfrak{q}} A[\phi(b)^{-1}].
\end{align*}
Putting all this together using the fact that the tensor product commutes with colimits, it follows that
\begin{align*}
A\otimes_B B_\mathfrak{q} &\cong A\otimes_B \varinjlim_{b\not\in\mathfrak{q}} B[b^{-1}]\\
&\cong \varinjlim_{b\not\in\mathfrak{q}}\left(A\otimes_B B[b^{-1}]\right)\\
&\cong \varinjlim_{b\not\in\mathfrak{q}}A[\phi(b)^{-1}]\\
&\cong \varinjlim_{D(b)\ni f(P)}\mathcal{O}_{\operatorname{Spec}(A)}(f^{-1}(D(b))).
\end{align*}
EDIT: As requested, we shall prove that the localization of a ring can be interpreted as a suitable colimit.
Let $A$ be a commutative ring, and let $S\subseteq A$ be a multiplicative set. Consider $S$ as a category whose objects are elements of $S,$ and whose hom-sets are given by
$$
\operatorname{Hom}_S(s,t) = \begin{cases}\ast,\qquad\textrm{if there exists }u\in A\textrm{ such that }t = su,\\
\emptyset,\qquad\textrm{otherwise}.
\end{cases}
$$
Then we may define a functor from $S$ to the category of commutative rings (or even commutative $A$-algebras, if you want) by
\begin{align*}
F : S&\to\mathsf{CRing}\\
s&\mapsto A[s^{-1}]\\
(s\to t)&\mapsto\left(A[s^{-1}]\to A[t^{-1}]\right).
\end{align*}
The map $A[s^{-1}]\to A[t^{-1}]$ is simply further localization: $A[t^{-1}]\cong (A[s^{-1}])[u^{-1}].$
Now, we want to show that the colimit of the diagram defined by this functor is the localization $S^{-1}A.$ That is, we want to show
Lemma: With notation as above,
$$\varinjlim_{s\in S} A[s^{-1}]\cong S^{-1} A.$$
Proof: We need to check that the colimit in question has the correct universal property; i.e., we must prove that given any morphism of rings $f : A\to T$ such that every element of $S$ is sent to a unit in $T,$ that we have a unique factorization of $f$ as $A\to \varinjlim_{s\in S} A[s^{-1}]\xrightarrow{f_S} T,$ where the first map is the canonical map.
By the universal property of localization, we find that for each $s\in S,$ $f$ factors uniquely as $A\to A[s^{-1}]\xrightarrow{f_s} T.$ Moreover, if $t\in S$ and $t = su,$ then we find that $f_t$ and $f_s$ are compatible in the sense that the composition
$$
A[s^{-1}]\xrightarrow{\textrm{can}} A[t^{-1}]\xrightarrow{f_t} T
$$
is simply $f_s.$
To see why the above is true, observe that $A[t^{-1}]$ is a localization of $A[s^{-1}]$ and $t\in A[s^{-1}]$ is sent to a unit in $T$ via $f_s,$ so there is a unique map $g : A[t^{-1}]\to T$ such that $f_s : A[s^{-1}]\to T$ factors through $g$ as $$A[s^{-1}]\xrightarrow{\textrm{can}}A[t^{-1}]\xrightarrow{g} T.$$ However, the composition $A\to A[s^{-1}]\xrightarrow{f_s} T$ is $f : A\to T,$ and the composition $A\to A[s^{-1}]\xrightarrow{\textrm{can}} A[t^{-1}]$ is simply the localization away from $t.$ Thus we see that $g$ satisfies the same property that $f_t$ does, and so uniqueness implies that $g = f_t.$
However, this compatibility between the various $f_s$ is precisely what is needed to obtain the map $\varinjlim_{s\in S} A[s^{-1}]\to T$ -- the universal property of a colimit now gives us a unique map $f_S : \varinjlim_{s\in S} A[s^{-1}]\to T$ factoring our given $f : A\to T,$ which is precisely what we needed. $\square$
Best Answer
Let $g:U\rightarrow X\times X$ to be the morphism induced by $g_1:U\rightarrow X$ (i.e. $g=g_1\times g_1$). Let $\pi_1 : X\times X \rightarrow X$ and $\pi_2 : X\times X \rightarrow X$ be the projection to each of the $X$ respectively. Then by definition, $\pi_1 \circ g =g_1$.
Now notice $\pi_1 \circ \Delta \circ h \circ i =id \circ g_1 = g_1$, then by universal property of $g$ (i.e. $g$ is the UNIQUE map such that $\pi_1 \circ g =g_1$), we have $\Delta \circ h \circ i = g$.
Similarly, notice $\pi_1 \circ h'' \circ i = h \circ i = g_1$, therefore $h'' \circ i = g$.
This means $h ''\circ i = \Delta \circ h \circ i$, which is the same as saying $h''(t_1)=\Delta(h(t_1))$.