I'm trying to prove that a local ring $(R,\mathfrak{m})$ contains a field if and only if $\mathrm{char}(R)$ and $\mathrm{char} (R/\mathfrak{m})$ are equal. To this we must relate the characteristic of $R$ to the characteristic of it's residue field $K=R/\mathfrak{m}$. If $\mathrm{char}(K)=0$, then, $\mathrm{char}(R)=0$. So $R$ contains a copy of $\mathbb{Z}$. Now, since $R/\mathfrak{m}$ has characteristic $0$, none of the images of non-zero integers in $R$ can be in $\mathfrak{m}$, else their images in $R/\mathfrak{m}$ will be zero, contradicting $\mathrm{char}(K)=0$. Then by the universal property of localization, $R$ contains $\mathbb{Q}$.
Now for the converse, I know that if $\mathrm{char}(K)=p$, then $\mathrm{char}(R)$ is $0$ a power of $p$, but I don't know how to completely prove this part. Why can't the characteristic be some non-prime integer? And furthermore, why can't $R$ contain a field in any case besides when $\mathrm{char}(R)= p$?
The reason the characteristic of the local ring $R$ will be a prime power if it is not equal to $0$ is that the maximal ideal must contain all zero divisors (
consider the image of a zero divisor in $R/\mathfrak{m}$since the maximal ideal in a local ring contains all nonunits). If the characteristic is $d=ab$, with $\gcd(a,b)=1$, then both $a$ and $b$ must lie in $\mathfrak{m}$, hence $1\in\mathfrak{m}$, which is impossible. Thus, the characteristic must be either $0$ or a prime power.If $\mathrm{char}(R) = 0$ and $\mathrm{char}(K)=p\gt 0$, then $R$ cannot contain a field: if it contained one, the field would contain $1$, hence $\mathbb{Z}$, hence $\mathbb{Q}$, but then $p$ would be a unit lying in $\mathfrak{m}$, which is impossible.
If $\mathrm{char}(R) = p^m$, $m\gt 0$, and $\mathrm{char}(K)=p$, then $R$ cannot contain a field: the field would necessarily contain $1$ and be of characteristic $p$ (since the characteristic of a subring must divide the characteristic of the ring), but then the subring generated by $1$ would be $\mathbb{Z}/p\mathbb{Z}$; however, the condition that $\mathrm{char}(R)=p^m$ means that the additive order of $1$ in $R$ is $p^m$, which shows $R$ cannot contain a field.
Added. As pointed out in comments, in fact the field wold contain $1$, and hence be of the same characteristic as $R$ (since the characteristic equals the additive order of $1$).