Solution (source code)

= Solution

Enlarge the space by an independent Brownian motion $W$ and define
$$
B_t=\int_0^t\mathbf1_{\{A_s>0\}}A_s^{-1/2}\,dX_s
+\int_0^t\mathbf1_{\{A_s=0\}}\,dW_s.
$$
The two terms have zero cross-variation and
$$
[B]_t=\int_0^t\mathbf1_{\{A_s>0\}}ds
+\int_0^t\mathbf1_{\{A_s=0\}}ds=t.
$$
The <Lévy characterization of Brownian motion> makes $B$ a Brownian motion. The residual $\int\mathbf1_{\{A=0\}}dX$ has zero quadratic variation and is therefore constant, so
$$
X_t-X_0=\int_0^tA_s^{1/2}\,dB_s.
$$