The question is about the proof to the proposition 6 in page 89 of Serre's a course in arithmetic.
Let $f$ be a modular function of weight $0$ on the upper half plane $\mathbb H$. The goal is to prove that $f$ is a rational function of $j:=1728g_2^3/\Delta$, where $\Delta:=g_2^3-27g_3^2$ ($g_k$ here are multiples Eisenstein series $G_k$).
In the proof, Serre assumes without loss of generality that $f$ is holomorphic on $\mathbb H$, otherwise one could always multiply $f$ by a polynomial $h$ of $j$ so that $h\cdot f$ is holomorphic. I don't know why we can always achieve this.
As far as I know from Serre's book, $j$ is a modular function of weight $0$ with a simple pole at infinity. But I don't see how to eliminate $f$'s poles by multiplying $f$ with a polynomial of $j$.