Your mandarin isn't nibbling on algae, it is simply starving to death like most of them do. Assuming yours is a wild-caught fish, the only thing it will eat is live copepods. You will need to either raise them, or buy them. If you tank is large (>100 gal, usually, very diverse and mature you might have a decent population of copepods already, and with some effort you can maintain that population while the fish eats. Alternatively, you can offer it Nutramar prawn eggs. To do this, take a small jar, like a clean (no soap, please) baby food jar, put some tank water in it and place a small amount of prawn eggs in the bottom. Then place the jar on its side, near the fish. If it is hungry enough it might enter the jar and eat some of the eggs. This is a delicate thing to do, and eventually you are going to have to train the mandarin to eat a more complete diet, but not right away, it will starve before you have a chance. Some people report that their mandarins eventually eat brine shrimp, flakes, etc, but trying to feed it those things now generally does not work. An easier solution might be to return the fish to your LFS for a refund or trade.
Return it. You don't know how to keep it, so it will likely die.