Might have been washed ashore or dropped by a bird.
Grouper (groper) like crabs and octopus. Of course they will eat other stuff. But anywhere you find small rock crabs and hiddie holes for small octopus, you will find grouper.
I have never caught a grouper from a boat. All the grouper I have caught have been land based off the rocks. Using fresh caught red crab or shop bought baby octopus...sometimes you might get lucky and find a small or baby occy in a rock pool and there is nothing better than a live baby occy if your target is grouper !!!
I have heard of catches from beaches. It is not common, but it does happen. It is hard to say because each beach is a bit different, but I would say if you are within 100 to 200 meters of where the rocks meet the sand, you are in grouper zone.
Baby occy...just go and buy some. Seriously !! They like to hide and you will never find them. If you find 2 baby occy's in your life, you are really, really lucky....so just buy some fresh at the fish market.
Crabs on the other hand are easy. First, you need some nerve and good rock shoes (with crampons is best). Have a friend that can "rescue" you if you get washed in...Wear a HELMET - let me say that again - wear a HELMET...No friend no matter how good they are is going to "rescue" you if you are unconscious in the water with a cracked skull...so wear a HELMET !!! All you need then is a sturdy length of wire or an old hand spear with only one prong. Make a small barb using a file and you are good to go. You will find the crabs right where the wash hits the rocks, so you will get hit by waves at knee to waist height and maybe higher (hence the good shoes and HELMET).
Black crabs are more common and can be be found higher up away from the wash. You still need a wire to get them out of the crevices...but they are just not as good as red crab...and red crab means your feet will get wet and you need to wear a HELMET !!
itsaboat mate...Life is just a boat and then ya marry one !