Let the EMF be E and Resistance be R...
When the battery is discharging, then the current is coming out of the positive terminal. then the potential across the battery terminals will be:
V = E - I R
9 = E - 3 R --- (1)
when the battery is charging, then the current goes inside the positive terminal. then : V = E + I R
12 = E + 2 R --- (2)
solving them, 5 R = 3 => R = 0.6 ohms.
E = 10.8 Volts or 54/5 Volts.