This is a difficult problem if you are expected to give a full formal argument. However, it is intuitively quite reasonable to assume that the "best" circles will be tangent to the diameter of the semicircle, tangent to each other, and tangent to the circle of radius $2$. Under the assumption that these are indeed the best circles, we will find the answer. (Alternately, we could look at the problem with a full circle instead of a semicircle, and four small circles, and assume that the symmetrical configuration is best.)
Draw a picture, and concentrate on the small circle $\mathcal{K}$ on the right. Let $O$ be the centre of the semicircle, and let $C$ be the centre of $\mathcal{K}$. Let $T$ be the point where $\mathcal{K}$ is tangent to the semicircle.
Note that the line $OT$ is perpendicular to the common tangent line at $T$. Note also that the line $CT$ is perpendicular to the common tangent line at $T$. It follows that the line through $O$ and $T$ is the same line as the line through $C$ and $T$. In other words, the radius $OT$ of the semicircle passes through $C$.
Let $r$ be the radius of $\mathcal{K}$. Drop a perpendicular from $C$ to the point $P$ on the diameter of the semicircle. Note that $OP=r$. By the Pythagorean Theorem, $(OC)^2=(PO)^2+(PC)^2=2r^2$, so $OC=\sqrt{2}r$. It follows that $2=OT=OC+CT=\sqrt{2}r +r.$ Now we are finished. We have $r=\frac{2}{\sqrt{2}+1}$. It may be that in the answer given, the denominator was rationalized by multiplying top and bottom by $\sqrt{2}-1$. That gives the answer $r=2(\sqrt{2}-1)$.

Added: Thanks to David Mitra for the diagram!