The surface gravity of a planet is very close to
$$g=\frac{4\pi G}{3}\rho r.$$
With $g$ to be kept constant, and $\frac{4\pi G}{3}$ a constant, we need
$\rho_Pr_P=\rho_Er_E$, or
$$r_P=\frac{\rho_E}{\rho_P}r_E,$$
with $\rho_E=5.515 \mbox{ g}/\mbox{cm}^3$ the mean density of Earth, $r_E=6371.0 \mbox{ km}$ the mean radius of Earth, $\rho_P=22.59\mbox{ g}/\mbox{cm}^3$ the density of densest natural element osmium, and $r_P$ the radius of the fictive osmium planet.
Hence $$r_P=\frac{5.515}{22.59}r_E=0.2441~r_E=1555\mbox{ km}.$$
Some compression of the core of an osmium planet due to pressure is neglected.