Assume that $\im A$ is dense and let $x^{*}\in \dom A^{*}$ be such that $A^{*}x^{*} = 0$, i.e. $x^{*}(Ax) = 0$ for all $x\in \dom A$. Then $x^{*}(y) = 0$ for all $y\in \im A$, and since $\im A$ is dense, this implies that $x^{*} = 0$.
On the other hand, suppose that $\im A$ is not dense, i.e. there exists an $x\in E\setminus \overline{\im A}$. Since $\overline{\im A}$ is a closed subspace of $E$ and $x\notin \overline{\im A}$, as a consequence of the Hahn-Banach theorem, there exists an $x^{*}\in E^{*}$ such that $x^{*}|\overline{\im A} = 0$ and $x^{*}(x) \ne 0$. Since $x\mapsto x^{*}(Ax) = 0$ is continuous, we have $x^{*}\in \dom A^{*}$ and $A^{*}x^{*} = 0$, so $x^{*}\in \ker A^{*}$ and $x^{*}\ne 0$ (since $x^{*}(x)\ne 0$).