Let $M$ be a $1$-dimensional complex manifold. Let $A$ be the space of all holomorphic functions $f:M\to \mathbb{C}$ such that either $f$ is a constant function or every level set $f^{-1}(c)$ is a finite (probably empty) set.
Is $A$ an algebra of functions? Is its closure, with respect to topology of uniform convergence on compact subsets, equal to space of all holomorphic functions from $M$ to $\mathbb{C}$?



A generalization of polynomial algebra on a Riemann surface
Counterexample to the first question ("is $A$ an algebra of functions?"):
Let $M$ be a vertical strip such as {$x + iy : 0 < x < 1$},
and define $f\_1,f\_2$ as the restriction to $M$ of the 
entire functions
$$
f\_1(z) = \exp((1+i)z), \quad f\_2(z) = \exp((1-i)z).
$$
Then $f\_1,f\_2 \in A$ but $f\_1 f\_2 \notin A$. 
Indeed if $f\_1(z) = f\_1(z')$ or $f\_2(z) = f\_2(z')$ then
the real part of $z-z'$ is a multiple of $\pi$, so
all the level sets of $f\_1$ and $f\_2$ are of bounded size
(indeed size at most $1$ for our width-$1$ strip).
But $f\_1 f\_2$ is the function $z \mapsto e^{2z}$,
whose level sets are translates of $\pi i \bf Z$
and thus can contain infinitely many points of $M$.


It follows that $A$ is not closed under addition either:
if it were, then $A$ would contain $f\_1+f\_2$ and $f\_1-f\_2$, 
and since $A$ *is* closed under squaring this would imply that
$A \ni (f\_1 + f\_2)^2 - (f\_1 - f\_2)^2 = 4 f\_1 f\_2$.


