Let $L$ be a non-abelian Lie algebra. I need to show that $$\dim(Z(L)) \leq \dim(L) - 2$$
Now, if $\dim(L) = 2$ , then I know that this $L$ is a unique non-abelian Lie algebra such that its centre $Z(L) = 0$. Therefore, I'm done with the trivial case. But how do I prove the above inequality when $\dim(L) > n$ ,($n>2$)?
Let $x\in Z(L)^\perp$. Then $[x, z] = 0$ for all $z\in Z(L)$, and clearly $[x, x] = 0$. If $\dim Z(L) \geq \dim L - 1$, that forces $L$ to be abelian.