X-ray astronomy : stellar endpoints, AGN, and the diffuse X-ray background