I am trying to understand integration with respect to Haar measure. Here are the first two examples I can think of. Let $X$ be the variety corresponding to the circle: $$ X = \{ x^2 + y^2 - 1 = 0 \}$$ Then we can consider $X$ over any field... $X(\mathbb{R})$ is the Euclidean circle, but also $X(\mathbb{Q})$ is the rational points. Then we could consider the completions $X(\mathbb{Q}_p)$. Is it fair to assume that: $$ \overline{X(\mathbb{Q})} = X(\mathbb{Q}_p) $$ in the $p$-adic topology?
These points will now carry a lie group action, just the rotational symmetry of the circle $\text{SO}_2(\mathbb{Q}_p)$ which (superficially) looks like it should behave similar to $\text{SO}_2(\mathbb{R})$.
What is the "average" value of $x$ and $x^2$ with respect to these measures.
I'd expect by symmetry that $\int_X x \, d\mu_p = 0$
What could $\int_X x^2 \, d\mu_p$ evaluate to?
Here we get an answer that should work for any measure:
$$2 \int_X x^2 \, d\mu_p = \int_X x^2 \, d\mu_p + \int_X y^2 \, d\mu_p = \int_X (x^2 + y^2) \, d\mu_p = \int_X 1 \, d\mu_p = 1$$
but the question of integrating function over Haar measure over the circle remains. I guess next would be 4th moment?
$$ \int_{X = \{ x^2 + y^2 - 1 = 0 \} } x^4 \, d\mu_p $$
You’ve asked a question about the noncompactness of your set in some cases. It happens when $\sqrt{-1}\in\Bbb Z_p$, the integers of $\Bbb Q_p$. And this is for $p\equiv1\pmod4$. Let $i\in\Bbb Z_p$ satisfy $i^2+1=0$.
Letting $x=\frac1{p^n}$, we want to solve $x^2+y^2=1$ for $y$: \begin{align} y^2&=1-\frac1{p^{2n}}\\ y&=\sqrt{1-\frac1{p^{2n}}}\\ &=i\sqrt{\frac1{p^{2n}-1}}\\ &=\frac i{p^n}\sqrt{1-p^{2n}}\,, \end{align} and $1-p^{2n}$ has a square root in $\Bbb Z_p$ by Hensel’s Lemma, so that its $p$-absolute value is $1$, while the absolute value of $i/p^n$ is the (real) number $p^n$, which goes to infinity.