Let $C$ be a smooth projective irreducible curve over $\mathbb C$. Let $x$ and $y$ be distinct points of $C$.


We say that $f$ is totally ramified at a point $p$ if the ramification index of $p$ equals $\deg(f)$.


Does $C$ admit a finite map $f \colon C \to \mathbb P^1$ which is totally ramified at $x$ and $y$? 



Given a curve $C$, does there exist a rational function on $C$ totally ramified at two given points?
The answer is in general **no**. More precisely, the following holds.



> 
> A finite map $f \colon C \to \mathbb P^1$ as in the question exists if and only if $\mathcal{O}\_C(x-y)$ is a point of finite order in $\textrm{Pic}^0\, C$. 
> 
> 
> 


In fact, if $f$ exists, calling $n$ its degree we have $\mathcal{O}\_C(nx) = \mathcal{O}\_C(ny)$, that is $\mathcal{O}\_C(n(x-y))=\mathcal{O}\_C$, in other words the degree zero divisor $x-y$ defines a point of finite order in $\textrm{Pic}^0 \,C$. 


Conversely, if $\mathcal{O}\_C(x-y)$ is a point of finite order $n$ in $\textrm{Pic}^0 \, C$, then the two divisors $nx$ and $ny$ are linearly equivalent on $C$ and the linear pencil generated by them is a $g^1\_n$ without base points. Thus such a $g\_n^1$ defines a morphism $f \colon C \to \mathbb{P}^1$ of degree $n$, totally ramified at both $x$ and $y$.


