TITLE: An element $f$ that is integral over its affine coordinate ring: show there exists this open neighborhood
QUESTION [5 upvotes]: (Recall first the following definition: Let $R$ be an integral domain and $K$ its field of fractions. An element $a \in K$ is called an integral element over $R$ if there exists a polynomial $g = x^n + a_{n-1} x^{n-1} + \ldots + a_1 x + a_0 \in R[x]$ such that $g(a) = 0$. )
Problem: Consider an affine variety $X$ over $\mathbb{C}$. Let $R = \mathbb{C}[x_1, \ldots, x_n] / I$ be its affine coordinate ring, and let $K$ be its field of fractions. Prove that if $f \in K$ is an integral element over $R$, then for each point $x \in X$ there exists an open (in the usual Euclidean topology) neighborhood $U$ of $x$ and a real constant $B > 0$ such that $|f(y)| < B$ for all $y \in U$ where $f$ is regular. Show that this claim is false in general if $U$ is required to be Zariski open.
Attempt: I'm given a hint that I should use the maximum principle for holomorphic functions. I don't really know how to find this open neighborhood $U$. First, I believe that $K \cong \mathbb{C}(x_1, \ldots, x_n)/I$ (can someone confirm this)? 
So I assume $f \in K$ is integral over $R$. By definition there exists a polynomial $p(t) \in R[t]$ such that $p(f) = 0$. Can I assume that $f \in K$ is holomorphic? 
Any help with this problem is appreciated!

REPLY [3 votes]: For the fact that $f$ is locally bounded in euclidean topology please take a look to my answer of a duplicate question. I was not aware of the fact that it is a duplicate (many thank to reuns for pointing it out and giving a link to this question). 
Let me prove that there are such $f$ which are not locally bounded in Zariski topology. 
Fact Let $X$ be a smooth affine algebraic curve over $\mathbb{C}$. If $f$ is a bounded holomorphic function on $X$, then it is constant.
Proof.
Every smooth affine alg. curve $X$ is an open Zariski dense subvariety of a smooth projective curve $\overline{X}$. If $f$ is bounded on $X$, then by Riemann removable singularity theorem we deduce that $f$ extends to a holomorphic function on $\overline{X}$. Now the only holomorphic functions on compact Riemann surfaces are constant and $\overline{X}$ (from the point of view of analytic geometry) is a compact Riemann surface. Thus $f$ is constant. 
Example 1.
Pick a nonconstant regular function $f$ on smooth affine complex algebraic curve $X$. Then $f$ is unbounded on $X$ (by Fact) and hence it cannot be bounded on any nonempty Zariski open subsets of $X$. Indeed, any nonempty Zariski open subset of $X$ is cofinite and $f$ cannot be bounded on a cofinite subset of $X$ without being bounded on the whole $X$ ($f$ is continuous in euclidean topology). Clearly $f$ is integral over a coordinate ring of $X$ (it is an element of this ring, so this is obvious).
Example 2. You can also construct a more complicated counterexample. Pick $X$ an non-smooth (i.e. non-normal) affine complex algebraic curve $X$. Next fix a rational function $f \in \mathbb{C}(X)\setminus \mathbb{C}[X]$ which is integral over $\mathbb{C}[X]$. This is possible because $X$ is non-normal (by definition). Suppose now that $f$ is locally bounded in Zariski topology on its domain of definition. Then there exists an nonempty open Zariski subset $U$ of $X$ such that

$U\subseteq \mathrm{dom}(f)$
$U$ is contained in the smooth locus of $X$.

These follow because nonempty Zariski open subsets on $X$ are cofinite, smooth locus of $X$ and $\mathrm{Dom}(f)$ are nonempty Zariski open subsets of $X$. Now $f_{\mid U}$ is regular and bounded hence constant by Fact ($U$ is a smooth affine algebraic curve). Since $f$ is constant on a Zariski dense open subset $U$ of $X$, it is constant on $X$. This violates the assumption $f\not \in \mathbb{C}[X]$.