Assume $X$ is a Riemann surface and $\pi: E \to X$ is a holomorphic vector bundle of rank $n$ on $X$. Let's say $f$ is a holomorphic section of $E$ over $X$.
It is clear that if $f$ is a nonvanishing holomorphic function then $F := \bigcup_{x \in X} F_x \subset E$ (where $F_x = \mathbb{C} \cdot f(x)$) is a holomorphic subbundle of $E$ of rank 1 for which $f$ is a holomorphic section.
But I do not want to assume that our $f$ is nonvanishing. Then how do I construct a subbundle $F' \subset E$ of rank 1 such that $f$ is a holomorphic section of the subbundle...in other words, what do I do at the zeros? Obviously $\mathbb{C} \cdot f(x)$ is zero dimensional (not 1-dimensional) when $f(x)$ is the zero element of the vector space $\pi^{-1}(x)$. How do I "extend" the line bundle to these vanishing points to get a subbundle of $F' \subset E$ of rank 1 such that $f$ is a holomorphic section of $F'$? I would appreciate some help, I totally don't know how I could do it.
This is a special case of exercise 29.1(b) from Otto Forster's Lectures on Riemann Surfaces.