f-divergences and their applications in lossy compression and bounding generalization error