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.
Here's one way to do it. Take a trivialization $\phi$ of $E$ over a neighborhood $U$ of $x$. For convenience, think of $z\in\Bbb C$ as a holomorphic coordinate on $U$, with $x$ corresponding to $0$. If $\phi\colon \pi^{-1}(U)\to U\times \Bbb C^n$ is the trivialization, write $\phi(f(z)) = (z,\psi(z))$. Now we use the standard trick. Expand (the holomorphic component functions of) $\psi$ in power series centered at $0$ and factor out the largest power of $z$ possible. The remaining vector function has a nonzero limit as $z\to 0$, say $\ell\in\Bbb C^n-\{0\}$, and we can define the fiber $F'_x$ to be the span of $\phi^{-1}(x,\ell)$.