If you found this on a beach then chances are that it is ambergris. Amber, when rubbed quickly against your pants or on fine sandpaper smells like the old woodworking rosin, it is distinctive, a tree resin if it is not petrified. Don't make too much noise about it if you found it on the beach because ambergris is supposed to stay right there, unless you have a permit. States may vary with regulations, am not sure about them all but I do not it is very strict in Tasmania.
See if you can set a flame to it without setting it on fire then seeing if there is a very pleasant odour or a gum smell.