Ogg characterized the finitely many N such that $X\_0(N)\_{\mathbb{Q}}$ is hyperelliptic, and Poonen proved in "Gonality of modular curves in characteristic p" that for large enough N, $X\_0(N)\_{\mathbb{F}\_p}$ is not hyperelliptic.


**Question**: Are there any N such that $X\_0(N)\_{\mathbb{Q}}$ is not hyperelliptic but for some p not dividing N $X\_0(N)\_{\mathbb{F}\_p}$ is hyperelliptic? 


I'm also interested in this question for other modular curves of the form $X\_H$, where H is a congruence subgroup.



Hyperelliptic modular curves in characteristic p
I already gave the currently accepted answer to this question around 10 years ago. And the answer can be summarised as "Yes, here is an example". However, after 10 years I wanted to come back to this question and answer it again, but now in the opposite direction. Namely, as it turns out the example that I found above is the only example. To be more precise:


**Theorem.** Let $N$ be a positive integer, $p$ a prime not dividing $N$, and $X\_H$ a modular curve with of level N corresponding to a congruence subgroup $\Gamma\_1(N) \subseteq H \subseteq \Gamma\_0(N)$. Suppose that $X\_{H,\mathbb F\_p}$ is hyperelliptic but $X\_{H, \mathbb Q}$ is not, then $p=2$, $N=37$ and $H$ is the congruence subgroup generated by $\Gamma\_1(N)$ and $d\_4$ where $d\_4$ is a matrix representing the diamond operator $\langle 4 \rangle$.


This is Theorem 1.3 of <https://arxiv.org/abs/2307.04864>. In that theorem, the hyperellipticity is considered over $\overline {\mathbb F}\_p$ and $\mathbb C$. However, since all the curves $X\_H$ under consideration have a rational point, they are hyperelliptic over $\mathbb F\_p$ if and only if they are $\overline {\mathbb F}\_p$ and similar over $\mathbb Q$ and $\mathbb C$.


The proof is consisting of two steps, the first one is using the Castelnuovo-Severi inequality to establish an apriori upper bound on $N$, see Proposition 3.6 of loc. cit. The second step is checking for hyperellipticity by looking at the space of quadrics that vanish on the image of the canonical map, as in my other answer.


