Lemma 10 in Kaplansky's Infinite Abelian Groups states:
Let $G$ be a primary group, $H$ a pure subgroup, $x$ an element of order $p$ not in $H$. Suppose that $h(x)=r<\infty$, and suppose further that $h(x+a)\le h(x)$ for every $a$ in $H$ with $pa=0$. Write $x=p^ry$, let $K$ be the cyclic subgroup generated by $y$, and let $L=H+K$. Then $L$ is the direct sum of $H$ and $K$, and $L$ is again pure.
A word of explanation of terminology: "Primary group" here means abelian $p$-group (not necessarily finite....just every element has order a power of $p$). The function $h$ is the height function, where $h(u)$ is the largest $r$ such that $u=p^rv$ for some $v$. If there is no largest such $r$, then $h(u)=\infty$. A subgroup $H$ of $G$ is "pure" if, letting $h_H$ and $h_G$ be the respective height functions, $h_H(z)=h_G(z)$ for all $z$ in $H$.
Also, one elementary fact that will be used throughout is that if $h(a)\ne h(b)$ then $h(a+b)=\min(h(a),h(b))$, but if $h(a)=h(b)$ then we merely have that $h(a+b)$ is greater than or equal to their common value.
Kaplansky "proves" the above lemma by applying a previous lemma (lemma 7) that states:
Let $G$ be a primary group and $S$ be a subgroup with no element of infinite height. Suppose that the elements of order $p$ in $S$ have the same height in $S$ as in $G$. Then $S$ is pure.
Unfortunately his proof is wrong since he applied the previous result with $L$ in the role of $S$, but $L$ may have elements of infinite height, which makes the previous result inapplicable.
Here is my attempt to supply a correct proof. Comments welcome.
Any non-trivial subgroup of $K$ contains $x$, which is not in $H$, so we have $K\cap H=\{0\}$, and so their sum $L$ is direct, i.e., $L=H\oplus K$.
Now consider $w\in L$; we must show its height in $L$ equals its height in $G$.
If $w\in H$ then $h_H(w)\le h_L(w)\le h_G(w)=h_H(w)$ (since $H$ is pure) and so equality holds throughout.
If $w\notin H$, then $w=a+z$ with $a\in H$ and $z\in K$, $z\ne 0$.
(I) If $p(a+z)=0$, then $pz=pa=0$. But $pz=0$ means $z=mx$ for some $m$ prime to $p$, since $<x>$ is the unique order $p$ subgroup of $K$. Let $s$ be such that $sm\equiv 1 \pmod p$. Then $sa$ has order $p$, $sz=x$, and so in $G$ we have $h(sa+sz)\le h(sz)$ by hypothesis. For any $c\in G$, there is a $j$ and a $t\ge 1$ such that $h(smc)=h(c+jp^tc)=h(c)$. Also, $h(smc)\ge h(sc)\ge h(c)$, so $h(sc)=h(c)$. Thus, $h(a+z)=h(sa+sz)\le h(sz)=h(z)=h(x)=r$ in $G$. Case (i) If equality does not hold, then $h(a)=h(a+z-z)=\min(h(a+z),h(z))=h(a+z)$ in $G$. But also since we know $a$ and $z$ have the same heights in $G$ and $L$, and since they are not equal, $h_L(a+z)=\min(h(a),h(z))=h(a+z)$. Case (ii) if $h(a+z)=h(z)$ then $h(a)=h(a+z-z)\ge h(z)=h(x)$. If inequality holds then $h_L(a+z)=h(a+z)$ again follows, so suppose $h(a)=h(x)$; then $h(sa)=h(a)=r=h(x)=h(z)=h(a+z)=h(sa+x)$. But since $h_H(a)=h(a)=r$ and $x=p^ry$, we have $h(a+z)\ge h_L(a+z)=r=h(a+z)$. So even in this case $h_L(a+z)=h(a+z)$.
(II) If $pz=0$ but $pa\ne 0$ we may multiply by a number prime to $p$ and assume $z=x$. Also, we may assume $h(a)=h(x)=r$ or we are done. Clearly $h_L(a+x)=r$ and we suppose $h(a+x)>r$. Then $a+x=p^{r+1}b$ and $pa=p^{r+2}b$. Then $pa$ has height at least $r+2$ in $G$ and hence also in $H$. So $pa=p^{r+2}c$ for some $c\in H$. But then $a-p^{r+1}c$ is in $H$ and has order $p$ and height $r$. Thus by (I) $h((a+x)-p^{r+1}c)=h((a-p^{r+1}c)+x)=r$. Since $h(p^{r+1}c)>r$, this means $h(a+x)=r$.
(III) If $pz\ne 0$ then we may assume by induction on the order of $a+z$ that $h(pa+pz)=h_L(pa+pz)<\infty$. Call that height f. Then $p(a+z)=p^f(b+t)$ for some $b\in H$, $t\in K$, and $p^{f-1}(b+t)$ has height $f-1$ in both $G$ and $L$. Clearly $h(a+z)\le f-1$. Now $a+z=(((a+z)-p^{f-1}(b+t))+p^{f-1}(b+t))$. But $p((a+z)-p^{f-1}(b+t))=0$, so $((a+z)-p^{f-1}(b+t))$ has the same height $k$ in $G$ and $L$ by (I) and (II). If $k\ne f-1$ then $h(a+z)=h_L(a+z)=min(k,f-1)$. Otherwise $h(a+z)$ and $h_L(a+z)$ are both at least $f-1$, but neither can exceed $f-1$ lest $h(p(a+z))$ exceed $f$.
QED
However, see also Infinite Abelian Groups: Unnecessary Hypothesis in Kaplansky's Lemma 7 for perhaps an easier path.