A study of the stomach conents of the violet goby, Gobioides broussonnetii, (a very similar species) revealed that a large portion of their diet was composed of algae. Therefore I would assume that this species (especially when young) also eats algae. As they mature, they're be more likely to eat small fish and invertebrates.
I can't think of any specific method of getting a fish to eat pellets though. My violet goby never did, so I just went on to bloodworms.
Also, when it swims into the corner, does it go up the side and poke its head out of the water? That would indicate discomfort, possibly poor water quality or low oxygen levels. If it's sticking its head in the corner and biting the glass, it could be eating algae. Otherwise, it might just be looking for a partially closed in space to rest. They're burrowers in the wild so caves of some sort would be a good addition to the tank.
I can't think of any specific method of getting a fish to eat pellets though. My violet goby never did, so I just went on to bloodworms.
Also, when it swims into the corner, does it go up the side and poke its head out of the water? That would indicate discomfort, possibly poor water quality or low oxygen levels. If it's sticking its head in the corner and biting the glass, it could be eating algae. Otherwise, it might just be looking for a partially closed in space to rest. They're burrowers in the wild so caves of some sort would be a good addition to the tank.