$\mathrm{Z}(\mathfrak{gl}(2,\Bbb F))$ where the Lie bracket is $[X,Y]=XY-YX$ I want to find $\mathrm{Z}(\mathfrak{gl}(2,\Bbb F))$ where the Lie bracket is $[X,Y]=XY-YX$
So then this will depend on the field, but no harm in direct computation for arbitrary matrices:
$$x=\begin{bmatrix}a&b\\c&d\end{bmatrix},y=\begin{bmatrix}\alpha&\beta\\\gamma&\delta\end{bmatrix}$$
$$[x,y]=\begin{bmatrix}a\alpha+b\gamma-\alpha a - \beta c&a\beta+b\delta-\alpha b-\beta d\\c\alpha+d\gamma -\gamma a - \delta c&c\beta + d\delta - \gamma b-\delta d\end{bmatrix}$$
I want to find $x\in\mathfrak{gl}(2,\Bbb F)$, $[x,y]=0,\forall y$
In $\Bbb C$ or $\Bbb R$, the only possible elements are $\begin{bmatrix}0&0\\0&0\end{bmatrix},I$
In $\Bbb Z_2$, the top left position gives us $b=c=0$, so $$[x,y]=\begin{bmatrix}a\alpha-\alpha a&a\beta-\beta d\\d\gamma -\gamma a &  d\delta -\delta d\end{bmatrix}$$
That's easier to handle and we get $d-a=a-d=0$, which means the centre is:
$$Z(\mathfrak{gl}(2,\Bbb Z_2))=\left\{\begin{bmatrix}0&0\\0&0\end{bmatrix},I\right\}$$
How would I go about checking the centre for all fields? Will this always be the same?
 A: A consideration of $\mathfrak{gl}(n,\Bbb F)$:
Let $E_{ij} = e_i e_j^T$ denote the matrix with a $1$ in the $i,j$ entry.  Let $A$ be a matrix with entries $a_{ij}$.  We have
$$
AE_{ij} = (Ae_i)e_j^T\\
E_{ij}A = e_i(e_j^TA)
$$
Now, if $A$ is in the center, we must have for every $p,q$:
$$
e_{p}^T[A,E_{ij}]e_q = 0 \implies\\
e_p^T\left((Ae_i)e_j^T - e_i(e_j^TA) \right)e_q = 0 \implies\\
(e_p^T A e_i)(e_j^Te_q) - (e_p^Te_i)(e_j^TAe_q) = 0 \implies\\
a_{pi}\delta_{jp} - \delta_{pi} a_{jq}
$$
where $\delta$ denotes the Konecker delta.
By choosing different $i,j,p,q \in \{1,\dots,n\}$, you can deduce that $a_{ij} = 0$ when $i \neq j$, and $a_{ii} = a_{jj}$ for each $i,j$.
In other words, the only elements of the center are the multiples of $I$.  Note that this computation involves no division by a coefficient, and so it applies to all fields.
A: Since the Lie algebra $\mathfrak{g}=\mathfrak{gl}(2,K)$ is reductive, it is the direct sum of the commutator ideal and the center, i.e., we have
$$
\mathfrak{gl}(2,K)=\mathfrak{sl}(2,K)\oplus Z(\mathfrak{gl}(2,K)).
$$
Since $\dim \mathfrak{sl}(2,K)=3$, we obtain $\dim Z(\mathfrak{gl}(2,K))=1$. Because $I$ is in the center, it is a generator of the $1$-dimensional vector space, i.e., $Z(\mathfrak{gl}(2,K))=\{\alpha I \mid \alpha \in K \}$.
