Step 1: Build the work done from the force itself, not the energy formula.
Bring the first charge $q$ in for free. To bring the second charge $q$ in from infinity to a distance $r$, we push it against the repulsive Coulomb force $F(r') = \frac{1}{4\pi\varepsilon_0}\frac{q^2}{r'^2}$.
Step 2: Integrate the force over the path. \[ W = \int_{\infty}^{r} F(r')\, dr' = \frac{q^2}{4\pi\varepsilon_0}\int_{\infty}^{r} \frac{dr'}{r'^2} \]
Step 3: Evaluate the integral. \[ \int_{\infty}^{r} \frac{dr'}{r'^2} = \left[-\frac{1}{r'}\right]_{\infty}^{r} = \frac{1}{r} \]
Step 4: Combine to get the work done. \[ \boxed{W = \dfrac{1}{4\pi\varepsilon_0}\dfrac{q^2}{r}} \]