Suppose we are given a unital algebra $A$ and a central idempotent $a\in Z(a)$, i.e. $a^ 2=a$.
Consider the two-sided ideal $B:=A\cdot a$.
We have that $a$ is the unit in $B$. But the unit in $A$ (which was considered to be unital) is also a unit in $B\subset A$ and a unit is unique. So the unit $a$ is the unit in $A$?
No, suppose that $A$ is the ring of $2\times 2$ diagonal matrices and take $a=\pmatrix{1&0\cr 0&0}$.