The quaternion group $Sp(1)\simeq S^3$ can be understood as $(z,w)\in\mathbb {C}^2$ with $|z|^2+|w|^2=1$ where multiplication is defined by $(z,w)(t,s)=(zt-\bar{s}w,zs+\bar{t}w)$. 


**Question:** How do the nontrivial continuous idempotent functions (wrt convolution) look like? That is, functions $f\*f=f$, defined using Haar measure of 3-sphere.



Idempotent functions on Sp(1)
As Venkataramana says, this is a natural candidate for the Peter-Weyl theorem: Let $G$ be a compact group. Let $\{ V\_i \}\_{i \in I}$ be the set of isomorphism classes of irreducible complex representations of $G$ (for some index set $I$), and fix a $G$-invariant Hermitian inner product on each $V\_i$. Let $\{ e\_i^b \}\_{b \in B\_i}$ be an orthonormal basis of $V\_i$ and put $f\_i^{ab}(g) = \langle e\_i^a, g e\_i^b \rangle$. Then the Peter-Weyl theorem tells us that the $f\_i^{ab}$ are an orthonormal basis for $L^2(G)$ (with $\int\_G 1$ normalized to $1$). This basis identifies $L^2(G)$ with convolution with the Hilbert direct sum of matrix algebras
$$\bigoplus\_{i \in I} \mathrm{Mat}\_{|B\_i| \times |B\_i|}.$$
Let's write this isomorphism as $f \mapsto \left( \rho\_i(f) \right)\_{i \in I}$.
So a function in $L^2(G)$ is idempotent iff each matrix $\rho\_i$ is idempotent. Moreover, $|f|^2 = \sum\_{i \in I} |\rho\_i(f)|^2$ (right hand side is Frobenius norm) so $f \in L^2(G)$ implies $|\rho\_i(f)| \to 0$. The Frobenus norm of a rank $k$ idempotent is $\sqrt{k}$, so only finitely many $\rho\_i(f)$ can be nonzero. So such idempotents correspond to choosing finitely many nonzero subspaces $W\_i$ in finitely many $V\_i$. Explicilty, take an orthogonal basis $(u\_i^c)\_{c \in C\_i}$ for each $W\_i$ and form the sum $\sum \langle u\_i^c, g u\_i^c \rangle$. 


The simplest such example is to directly take the two dimensional representation
$$a+bi+cj+dk \mapsto \begin{bmatrix} a+bi & c+di \\ -c+di & a-bi \\ \end{bmatrix}$$
and project onto the $1$-dimensional subspace spanned by $\left[ \begin{smallmatrix} 1\\0 \end{smallmatrix} \right]$ to get the idempotent
$$\left\langle \begin{bmatrix} 1\\0 \end{bmatrix} ,\ \begin{bmatrix} a+bi & c+di \\ -c+di & a-bi \\ \end{bmatrix}\begin{bmatrix} 1\\0 \end{bmatrix} \right\rangle = a+bi.$$


