ZnO/Zn0.9Mg0.1O/ZnO heterostructure was grown by radio frequency plasma-assisted molecular beam epitaxy on a sapphire (0001) substrate. By using RBS/C, the depth-dependent elastic strain was deduced. The strain changes from negative to positive from interface to surface, and the value is higher at the depth close to the interface (also at the interface between ZnO and Zn0.9Mg0.1O) and decreases towards the surface. The negative tetragonal distortion was explained by considering the lattice mismatch and thermal mismatch between ZnO and sapphire substrate, and the positive distortion is due to the tensile strain in the parallel direction of Zn0.9Mg0.1O and the gradual release of the strain.