Suppose that $A\subseteq \mathbb{N}$ and suppose that you have an estimate of the form $$ \sum_{\substack{a\le x \\ a\in A}}f(a) \sim g(x). $$ With this information is it possible to get an asymptotic estimate for $\sum_{\substack{ab\le x \\ a,b\in A}}f(a)f(b)$? I would appreciate any reference in this kind of problem.
For example if $A$ is the set of prime numbers and $f(a)=1$, then we know that $$ \sum_{p\le x} 1 =\pi(x)\sim \frac{x}{\log{x}}. $$ Now, $$ \sum_{pq\le x}1=\pi_2(x)=\sum_{j=1}^{\pi(x^{1/2})}\left[\pi\left(\frac{x}{p_j}\right)-j+1\right] $$ so that (after some calculations) $$ \sum_{pq\le x} 1 =\pi_2(x)\sim \frac{x\log{\log{x}}}{\log{x}} $$ So I was wondering if it's possible to generalize without relying too much on properties about $A$. The case I'm currently interested is when $A$ is the set of fundamental discriminants. In this case, we know that $$ \sum_{\substack{|D|\le x \\ D\in A}} 1\sim \frac{x}{\zeta(2)} . $$ With this information is it possible to get an estimate for $\sum_{\substack{|D_1D_2|\le x \\ D_1,D_2 \in A}}1$?