Let $F$ be a cumulative distribution function and $$dF(x)=\begin{cases}dx/3&x\in (0,1)\cup(2,3)\\1/6&x \in \{1,2\}\\0&\mathrm{elsewhere}\end{cases}$$
Find a continuous cdf $H$, a discrete cdf $G$ and a real constant $c$ such that $$F(x)=cG(x)+(1-c)H(x)\ \forall x$$
What is the best method of solving such tasks?
$c=1/3$, $H(x)=x/2,\ x \in (0,1)\cup (2,3)$ but that's just a guess. How can I solve the problem instead of trial and error?
$$cG+(1-c)H=F=\begin{cases}0,&x<0\\x/3,&0\le x<1\\1/2,&1\le x<2\\x/3,&2\le x<3\\1,&x\ge3\end{cases}$$
$G(x)$ is a staircase function and $H(x)$ is continuous. From the above equation, for $c\ne0$, you know two things:
Thus, the sets of points of discontinuity of $F$ and $G$ are identical. So $G(x)$ has a jump at $1,2$ and these jumps are equal to $\Delta/c=1/6c$. If you take$$G(x)=\begin{cases}0,&x<1\\1/6c,&1\le x<2\\1/3c,&x\ge2\end{cases}$$Then $x_2=1$ gives $c=1/3$.
Now you can find $H(x)$ by solving $H(x)=[F-cG]/(1-c)$.