Even if you can find a Wifi connection almost everywhere in Bali, the most convenient way to stay connected and use your smartphone as you want is to buy a local prepaid SIM card.
You can find them everywhere, even in the arrival terminal at the airport. You can choose between different package depending on your usage. You can also buy them in all the small supermarket around the island (Indomaret, Alphamart, CircleK, …).
The two main operators are XL and Telkomsel. They both have a similar coverage. Be careful not to buy a “local” internet package if you plan to visit some other islands. These packages will only work in Bali and you will not be able to use your data if you go to Lombok or to the Gili islands for example.