If $A$ is a real or complex algebra and $a\in A$ is such that $ab=0$ for all $b\in A$, then $a=0$?

We cannot conclude this. Indeed, on any vector space $V$ over any field, one can define multiplication by assigning $vw=0$ for all $v,w\in V$.

Of course, if your algebra $A$ is unital, with unit $e$, then the conclusion does hold. Indeed, $a=ae=0$.

Moreover, there is a more elementary proof that this is true for $C^*$-algebras

Let $A$ be a $C^*$-algebra, and suppose $a\in A$ satisfies $ab=0$ for all $b\in A$. Then $$0=\|aa^*\|=\|a\|^2.$$ Thus $\|a\|=0$, and therefore $a=0$.


Hopefully, I am not saying something stupid.

Pick your favourite algebra $A$.

Let $a \notin A$ be any element, and define $$B= \mathbb{F} a \oplus A$$ where $\mathbb{F}$ is your field.

Now, $B$ becomes an algebra, under the obvious addition and multiplication defined as $$(\alpha a+b)(\beta a +c)=bc$$

And clearly $aB=0$.