Let $k$ be a number field, and let $\mathbb A_k$ be the ring adeles of $k$. The quotient group $\mathbb A_k/k$ is compact, and the choice of a nontrivial character $\psi$ of $\mathbb A_k/k$ gives an isomorphism $a \mapsto \psi_a$ of the additive group $k$ with the Pontryagin dual $(\mathbb A_k/k)^{\ast}$ of $\mathbb A_k/k$, where $\psi_a(x) = \psi(ax)$.
Question: If $f: \mathbb A_k/k \rightarrow \mathbb C$ is a function, under what circumstances do we have a "Fourier expansion" of $f$, as
$$f(x) = \sum\limits_{a \in k} c_a \psi(ax) \tag{$x \in \mathbb A_k$}$$
The situation of $\mathbb A_k$ and $k$ is of course an analogy with $\mathbb R$ and $\mathbb Z$. The quotient group $\mathbb R/\mathbb Z$ is compact, and the choice of the character $\psi(x) = e^{2 \pi i x}$ of $\mathbb R/\mathbb Z$ gives an isomorphism $n \mapsto e^{2\pi i nx}$ of $\mathbb Z$ with $(\mathbb R/\mathbb Z)^{\ast}$.
The complex Hilbert space $L^2(\mathbb R/\mathbb Z)$ of square integrable complex valued functions has $e^{2\pi i nx} : n \in \mathbb Z$ as an orthonormal basis (with a suitably normalized Haar measure on $\mathbb R/\mathbb Z$), so every measurable function $f: \mathbb R \rightarrow \mathbb C$ satisfying $f(x+1) = f(x)$ for almost all $x$, and $\int_0^1 |f(x)|^2 dx < \infty$ can be written as
$$f(x) = \sum\limits_{n \in \mathbb Z} c_n e^{2\pi i nx}$$
for almost all $x$ and for uniquely determined $c_n \in \mathbb C$.
Let $G$ be a compact Hausdorff topological group, and let $\hat{G}$ be the set of isomorphism classes of irreducible unitary representations of $G$. It is a consequence of the Peter-Weyl theorem that each $\pi \in \hat{G}$ is finite dimensional, and the right regular representation $L^2(G)$ is isomorphic to a Hilbert space direct sum of subrepresentations
$$\bigoplus\limits_{\pi \in \hat{G}} \bigoplus_{i=1}^{\operatorname{Dim}\pi} \pi$$
Explicitly, the direct sum $V = \bigoplus_{i=1}^{\operatorname{Dim}\pi} \pi$ occurs in $L^2(G)$ as the span of the matrix coefficients of $\pi$. If $e_1, ... , e_n$ is an orthonormal basis of $G$, then $c_{ij}(g) = \langle e_j, \pi(g)e_i\rangle$, possibly with some scalar modification, form an orthonormal basis of $V$.
In particular, assume $G$ is abelian, for example $G = \mathbb R/\mathbb Z$ or $G = \mathbb A_k/k$. Then each irreducible unitary representation is one dimensional, i.e. a character. If $\chi$ is a character of $G$, the corresponding matrix coefficient is just the function $g \mapsto \chi(g)$. Thus the characters of $G$ form an orthonormal basis of $L^2(G)$. So if $f \in L^2(G)$, we can uniquely write
$$f(g) = \sum\limits_{\chi \in \hat{G}} c_{\chi} \chi(g)$$
for uniquely determined $c_{\chi} \in \mathbb C$. If we want to isolate $c_{\chi}$, we use the orthogonality relations
$$\int\limits_G \chi_1(g) \overline{\chi_2(g)}dg = \begin{cases} \operatorname{meas}(G) & \textrm{if } \chi_1 = \chi_2 \\ 0 & \textrm{if } \chi_1 \neq \chi_2 \end{cases}$$
which implies $c_{\chi} = \frac{1}{\operatorname{meas}(G)} \int\limits_G f(g) \overline{\chi(g)} dg$.
EDIT: There is a problem here. The series $F(g) = \sum\limits c_{\chi} \chi(g)$ only converges in the $L^2$ norm to $f$, not pointwise. So I still don't know.