# When does the residue field of a local ring embed back into the local ring (nicely)?

Let $A$ be a local ring with maximal ideal $\mathfrak{m}$ and residue field $k:=A/\mathfrak{m}$, which fit into a s.e.s. $$0\ \longrightarrow\ \mathfrak{m}\ \longrightarrow\ A\ \longrightarrow\ k\ \longrightarrow\ 0,$$ of $A$-modules. I'm curious to know under what conditions it splits. It splits if $k$ is finite, and trying a few examples suggests it also splits if $\operatorname{char}(k)=0$, or at least when $k$ is algebraic over $\Bbb{Q}$. But I'm struggling to get a grip on the problem for residue fields that are not algebraic over their prime field. Some help or a reference is very welcome.

As said in the comments, the $A$-module map $A \to A/\mathfrak m$ never splits as a map of $A$-modules, if $\mathfrak m \neq 0$.
The correct formal translation of your title "When does the residue field of a local ring embed back into the local ring (nicely)?" is asking whether the map $A \to A/\mathfrak m =: k$ splits as a ring map, i.e. whether $A$ has the structure of a $k$-algebra, such that $k \to A \to k$ is the identity map.
One situation with affirmative answer is $A=R_{\mathfrak m}$ with $R$ a finitely generated $k=\bar k$-algebra and $\mathfrak m$ a maximal ideal.