Since Z=X-Y. Range is from [0,1]. So by convolution formula,

\(f_{Z}(z)=\int_{0}^{1}f_{X,Y}(z+y,y)\)

\(=\int_{0}^{z}2dy=2(y)_{0}^{z}=2z\)

Therefore,

\(F_{Z}(z)=\begin{cases}0. & z\leq 0\\2x. & 0\leq z\leq 1 \\ 1. & z\geq 1\end{cases}\)

\(f_{Z}(z)=\int_{0}^{1}f_{X,Y}(z+y,y)\)

\(=\int_{0}^{z}2dy=2(y)_{0}^{z}=2z\)

Therefore,

\(F_{Z}(z)=\begin{cases}0. & z\leq 0\\2x. & 0\leq z\leq 1 \\ 1. & z\geq 1\end{cases}\)