Field strength vanishes iff $A_{\mu}$ is pure gauge Is it true that the field strength $F_{\mu\nu}$ in a non-Abelian gauge theory with gauge group $G$ vanishes if, and only if, the gauge field $A_{\mu}$ is a pure gauge?
I can show one implication. 
If $A_{\mu}=\frac{i}{g}U\partial_{\mu}U^{\dagger}$ where $U \in G$, then the field strength vanishes, but I am struggling with the other implication.
 A: TL;DR: Vanishing field-strength $F=0$ does not imply that the gauge potential $A$ is pure gauge. It only holds locally. There could be global obstructions. In fact, topological obstructions could happen even if the gauge group $G$ is Abelian.
More details:

*

*The starting point is a connected (but not necessarily simply connected) gauge Lie group $G$ and a globally defined gauge potential $A$ on a connected (but not necessarily simply connected) spacetime manifold $M$. In this answer the covariant derivative is by convention $\mathrm{D}=\mathrm{d}-A$, i.e. $A$ is typically an anti-Hermitian matrix-valued 1-form. A gauge transformation takes the form
$$A^{\prime}~=~-U(\mathrm{D} U^{-1}), \qquad U~\in~G.\tag{1}$$


*Let us warm up by reviewing the easy way. If $A^{\prime}$ is pure gauge $A^{\prime}=-U(\mathrm{d} U^{-1})$, then there exists a gauge transformation (1) such that the new gauge potential $A=0$ vanishes identically, and hence the (new and old) field strengths $F^{\prime}=UFU^{-1}=0$ vanish identically.


*Next let us return to OP's question and sketched the proof of the opposite implication in a simply connected region $\Omega\subseteq M$ containing a fiducial point $x_{0}\in M$:

*

*For a point $x\in \Omega$ choose a path/curve $C$ from $x_0$ to $x$.


*Define group element via a Wilson line$^1$
$$ U(x,x_0)~:=~P e^{\int_{C} \!A},\tag{2}$$
where $P$ denotes path ordering.


*Next use the non-Abelian Stokes' theorem to argue that this definition (2) does not depend on the curve $C$, because $F=0$.


*Finally, use the group-valued section (2) to gauge transform the gauge potential $A$ to be zero.




*Example:  Consider the punctured plane $M=\mathbb{R}^2\backslash\{(0,0)\}$ with coordinates
$$ \begin{align}x~=~&r\cos\theta, \qquad y~=~r\sin\theta, \cr \theta~\sim~&\theta+2\pi,\qquad r~>~0;\end{align}\tag{3}$$ and with Abelian gauge group $G=U(1)$.
Let the (imaginary valued) gauge potential 1-form be
$$-iA~=~\frac{x\mathrm{d}y-y\mathrm{d}x}{x^2+y^2}~=~\mathrm{d}\theta~=~-iU^{-1}\mathrm{d}U,\tag{4}$$
where $$U(x,y)~=~e^{i\theta(x,y)}~\in~G\tag{5}$$ is a globally well-defined group-valued section. The field strength $F$ vanishes, so the gauge potential (4) is pure gauge. However, if we scale $A\to \lambda A$ in eq. (4) with a non-integer constant $\lambda\in\mathbb{R}\backslash\mathbb{Z}$, then $A$ will no longer be pure gauge (because the corresponding $U=e^{i\lambda\theta}$ becomes multivalued), but $F$ will still be zero.
--
$^1$ If $G$ is not simply connected then work in the universal covering group $\tilde{G}$. We can always later project down to $G$.
