Question about a proof involving local rings: $R$ has exactly $3$ ideals, show that if $a,b\in I$ then $ab=0$

As far as I can tell, the reasoning at the very end of your proof does not make any sense. Certainly, $R$ must have zero-divisors, since you are trying to prove that the product of any two elements of $I$ is zero!

In general, I think the structure of your proof is good, but you are over-complicating things. As Mark Saving notes in the comments, one may deduce that $I$ is principal, generated by some nonzero $x \in I$. Hence, it is enough to deduce that $x^{2} = 0$, as every element of $I$ is a multiple of $x$.

Indeed, suppose $x^{2} \neq 0$. Then the principal ideal generated by $x^{2}$ properly contains $\{0\}$ and is contained in $(x)$; by our hypothesis that $R$ contains three ideals, we must have $(x^{2}) = (x)$. In particular, there exists some $y \in R$ such that $x^{2}y = x$, whence rearranging and factoring gives $x(xy-1) = 0$. But as you noted in the first paragraph of your proof, $xy-1$ must be a unit, since if $xy-1 \in I$, then $1 \in I$, which contradicts $I \neq R$. Right multiplying both sides by $(xy-1)^{-1}$, we thus conclude that $x = 0$, the desired contradiction.