Let $\mathfrak{g} \subset \mathfrak{gl}(V)$ for some finite dimensional vector space $V$, over an algebraically closed field $\mathbb{F}$ of characateristic $0$.
Suppose that $\rho: \mathfrak{g} \to \mathfrak{gl}(V)$ and that $V$ is irreducible as a $\mathfrak{g}$ representation. Moreover, for any $x \in \mathfrak{g}$, tr$(\rho(x)) = 0$. Then $\mathfrak{g}$ is semisimple.
My attempt:
I've used Lie's theorem and Lie's lemma to show that $\rho(\mathfrak{g})$ is semisimple;
the assumption of irreducibility allows us to conclude that the weight space of some
$\lambda :$ rad$\rho(\mathfrak{g}) \to \mathbb{F}$ is $V$ itself.
From here, since tr$(\rho(x)) = 0$, and since $h(v) = \lambda(h)v$ for any $v \in V$ and any $h \in$ rad$\rho(\mathfrak{g})$, we have that rad$\rho(\mathfrak{g})$ must be zero, since char$\mathbb{F} = 0$.
Is the fact the image is semisimple relevant? How I can go back to the original Lie algebra $\mathfrak{g}$, or am I off track?
Counterexample: $\mathfrak{g}:=\mathfrak{gl}_2(\Bbb C)$ which has a one-dimensional centre $\mathfrak{z}$, and let $\rho$ be the compositition
$$\rho: \mathfrak{gl}_2(\Bbb C) \twoheadrightarrow \mathfrak{gl}_2(\Bbb C) / \mathfrak{z} \simeq \mathfrak{sl}_2(\Bbb C) \subset \mathfrak{gl}_2(\Bbb C).$$
Maybe what is meant in the question is that the given inclusion $\mathfrak{g} \subset\mathfrak{gl}(V)$ itself is irreducible when viewed as representation? Then you're done if you managed to show that $\rho(\mathfrak g)$ is semisimple.
Added: A comment asked to explain how to get semisimplicity. To rephrase what OP says in the question:
Let $R := rad(\mathfrak g)$ the radical of $\mathfrak g$ (i.e. its maximal solvable ideal). Our goal is to show $R=0$. Now, restricting the natural representation to $R$ we have a representation of $R$ on $V$. Assume w.l.o.g. $V \neq 0$. By Lie's Theorem (applicable since $R$ is solvable) there exists a nonzero vector $v \in V$ and a functional $\lambda: R \rightarrow \mathbb C$ such that for all $r \in R$, $r.v = \lambda(r) \cdot v$.
By what this question calls the "invariance lemma" (which is proven e.g. in step 4 of the Wikipedia article about Lie's Theorem linked above), the space $\{v \in V : r.v = \lambda(r) \cdot v \}$ is not just invariant under $R$, but under the action of all of $\mathfrak g$. (This is the big hammer we need for this -- I admit this is not a trivial result!)
Since we showed above that this space is not $0$, by the irreducibility condition it must be all of $V$. That means that for all $r \in R$ and $v \in V$, $r.v = \lambda(r)v$, i.e. $r$ operates via the scalar $\lambda(r)$, i.e. it must be a scalar matrix. (Compare this part of the proof to Irreducible action of a solvable ideal in $\mathfrak{gl}(n)$ implies that the ideal has only scalar matrices). But in characteristic $0$, the only scalar matrix with trace $0$ is the zero matrix. So $R$ had to be $=0$ all along.