Inspired by [A discontinuous construction](https://mathoverflow.net/questions/323713/a-discontinuous-construction):
Does there exist a function $a \colon [0,1] \to (0,\infty)$ and a family $\{D\_x \colon x \in [0,1]\}$ of countable, dense subsets of $[0,1]$ with $\bigcup\_{x \in [0,1]} D\_x = [0,1]$ and $\sum\_{r \in D\_x} a(r) < \infty$ for all $x \in [0,1]$,



Existence of a strange function
The relation
$$
x\sim y \quad \iff \quad x-y\in\mathbb{Q}
$$
is an equivalence relation that partitions $[0,1]$ into countable sets of the form $[t]=(t+\mathbb{Q})\cap [0,1]$.  

The set of all equivalence classes of the relation $\{[t]:\,t\in [0,1]\}$ has the same cardinality as $[0,1]$. Consider a bijection 
$$
\psi:[0,1]\to\{[t]:\, t\in [0,1]\}.
$$
For $x\in [0,1]$ we define $D\_x=\psi(x)$. Since the sets $D\_x$ are precisely equivalence classes of $\sim$, we have that they are countable, dense and $\bigcup\_{x\in [0,1]} D\_x=[0,1]$.
Each of the sets $[t]=(t+\mathbb{Q})\cap [0,1]$ is countable infinite. Let 
$$
\phi\_{[t]}:[t]\to\{n^{-2}:\, n\in\mathbb{N}\}
$$ be a bijection defined for each of the equivalence classes.
Finally we define
$$
a:[0,1]\to (0,\infty)
\quad\text{by}\quad
a(x)=\phi\_{[x]}(x).
$$
It is easy to see that the function $a$ has the desired property since
$D\_x=[t]$ for some $t$ and hence
$$
\sum\_{r\in D\_x} a(r)=
\sum\_{r\in [t]}\phi\_{[r]}(r)=
\sum\_{r\in [t]}\phi\_{[t]}(r)=
\sum\_{n\in\mathbb{N}} n^{-2}=\frac{\pi^2}{6}.
$$
In the second equality we used the fact that $[r]=[t]$ for $r\in [t]$ which is a property of any equivalence relation.


