Let $G$ be a smooth affine algebraic group over a field $k$. If $G_{\bar{k}}$ is commutative over $\bar{k}$, is it necessary that $G$ is a commutative algebraic group over $k$?
I think the answer is yes. Since the formation of centralizer commutes with extension of the base field, we have $Z(G)_{\bar{k}}=Z(G)_{\bar{k}}=G_{\bar{k}}$ so $Z(G)=G$. The "smoothness" seems to be unnecessary here so I don't know if my attempt is wrong or not.
A straightforward way to see this, is by noting that for two $k$-schemes $X,Y$ with morphisms $$ f:X\to Y \ , \ g:X\to Y$$ $f=g$ iff $f_{\bar{k}}=g_{\bar{k}}$, see for example this question.
As commutativity (by definition) means $m=\sigma\circ m$, where $$\sigma:G\times G\to G$$ is the permutation $\sigma(g,h)=(h,g)$, the result follows.