Consider, within the Polish space $\mathbb{R}^\mathbb{Q}$ (with product topology), the subset of all those maps that can be extended to a continuous map on all of $\mathbb{R}$.
It's easy to see that this set is co-analytic. But is it sharply so, or is it actually a Borel set?
Yes, it's Borel. Let's call the desired set $C$.
Note that a function $f : \mathbb{Q} \to \mathbb{R}$ has a continuous extension to $\mathbb{R}$ iff $f$ is uniformly continuous on bounded sets. (For the forward direction, a continuous function is uniformly continuous on relatively compact sets. For the backward direction, use the fact that uniformly continuous functions map Cauchy sequences to Cauchy sequences.) Or, equivalently, if it's uniformly continuous on each interval $[-N,N] \cap \mathbb{Q}$.
Now to write out the definition, $f$ is uniformly continuous on $[-N,N]$ iff for all $\epsilon$ (without loss of generality, assume $\epsilon$ is of the form $1/n$) there exists $\delta$ (also of the form $1/m$) such that whenever $p,q \in [-N,N] \cap \mathbb{Q}$ with $|p-q| < 1/m = \delta$, we have $|f(p) - f(q)| < 1/n = \epsilon$.
Let $U_{p,q,n} = \{f \in \mathbb{R}^\mathbb{Q} : |f(p) - f(q)| < 1/n\}$. By definition of the product topology and continuity of subtraction, $U_{p,q,n}$ is open. Let's also let $A_{N,m} = \{(p,q) \in ([-N,N] \cap \mathbb{Q})^2 : |p-q| < 1/m\} \subset \mathbb{Q}^2$ which is countable. Then we can write the desired set $C$ as $$C = \bigcap_{N=1}^\infty \bigcap_{n=1}^\infty \bigcup_{m=1}^\infty \bigcap_{(p,q) \in A_{N,m}} U_{p,q,n}.$$
So $C$ is (at worst) $G_{\delta \sigma \delta}$. If I am counting correctly I think this is $\mathbf{\Pi}^0_4$.
One uses tricks like this a lot in probability theory, where we deal with stochastic processes, which correspond to probability measures on function spaces. You very often need to show that the set of all functions with some property is measurable, and it usually turns out to be Borel of pretty low rank. Proofs often go like this, where you exploit some analysis fact to get a convenient characterization of the property, and then use a little bit of care to only have to quantify over countable sets.
Alternatively, if you'd rather use fancier theorems: the space $C(\mathbb{R})$ of all continuous functions $f : \mathbb{R} \to \mathbb{R}$ is Polish, with the topology of uniform convergence on compact sets (UOCS). A sequence converging UOCS converges pointwise at each rational, so the map $\Phi : C(\mathbb{R}) \to \mathbb{R}^{\mathbb{Q}}$ defined by $\Phi(f) = f|_{\mathbb{Q}}$ is continuous; in particular it's Borel. It's also injective (two continuous functions which agree on the rationals must agree everywhere), and its image is the desired set $C$. Now in Polish spaces, the image of a Borel set under an injective Borel function is always Borel; you can find this theorem in descriptive set theory books.
(Alternatively alternatively, this argument showed $C$ is analytic, and you already knew it is coanalytic, so it must be Borel. But now we're really using nuclear weapons to kill tiny arthropods.)