Salam alaikum, "If you commit a sin in private, then perform a good deed in private. And if you commit a sin openly, then perform a good deed openly, so that this may counterbalance that." (Ibn al-Jawzi, Sifat al-Safwah Vol. 1, p. 258) Ustadh is this authentic? And isnt it considered Riya?

Ustadh AbdulAziz al-Haqqan
It is a hadith of the Prophet (sallallahu alayhi wa sallam) to Muadh ibn Jabal radiyallahu anhu, not a saying of Ibn al-Jawzi, and al-Albani rahimahullah graded it hasan by the sum of its routes while al-Haythami rahimahullah said its chain is hasan. And it is not riya.