As Mario enemies, goombas are most important as the most basic type of enemy. They can be dispatched with a single stomp, which permanently kills them. They were first introduced in Super Mario Bros., and have appeared in almost every main Super Mario sequel since then. Although usually a basic enemy, they have been shown to have different versions: flying, micro, macro, and so on. But in general, they are cannon fodder, moving thoughtlessly in one direction, falling into bottomless pits without flinching, and endlessly being pummeled by Mario's feet or scorched by his fireballs. One game in the series, Super Mario World, had a goomba that failed to provide a satisfying squish upon being stomped, but instead just became dazed and turned upside down. This was later explained as not being a true goomba, but instead being a cousin of some sort.
Little of the motivation and characterization of the goomba has been explained. The manual for the first Super Mario Bros. game notes that the Goomba was "A mushroom who betrayed the Mushroom Kingdom". I think it is curious that we never see a mushroom of the form of the Goomba not in the employ of Bowser and the Koopa Tribe, and that Goombas look very different from other mushroom citizens, such as Toad and Princess Peach, who are both much more anthropomorphic than the Goombas. Although it is a dark thought, I wonder if the Goombas were an oppressed class in a Mushroom Kingdom where anthropomorphication represented social status, and they welcomed the Koopas as liberators from their servitude. This rebellion was met with endless cycles of plumber boot as they were used as pawns in a war they could not escape.
Feel free to ignore that last paragraph and just think of goombas as one more obstacle in a cheerful game of thumb exercising.