Menma was a former bandit from the Land of Rice Fields whose real name remains unknown. Naruto gave him the nickname "Menma" after finding him—it's a reference to fermented bamboo, which Naruto happened to be searching for at the time. The kid had shown up with amnesia (technically a memory-blocking jutsu, though he didn't know that), and Naruto brought him back to Konoha to recover.
What triggered his amnesia was falling off a cliff while trying to save a young girl from bandits who'd killed her father during a raid. Menma had actually left the gang over that exact incident—watching one of them murder someone in front of their kid was the last straw for him.
While recovering in the hospital, a fire broke out and Menma's memories suddenly came back when he rescued an infant from the flames. He wasn't thrilled about remembering his past, but he was allowed to stay in the village. He and Naruto built solid relationships with the elders by taking on whatever odd jobs came their way.
When bandits attacked again, Menma went searching for more of his memories with Naruto, Neji, and Tenten. He ultimately died stopping them—sacrificed himself to trigger an explosion that kept the bandits from flooding the village. The loss hit Naruto hard; afterward, he kept Menma's ocarina, the only thing left of him, and would pretend to share legendary fermented ramen with it.
Menma could channel ninjutsu through his ocarina, boosting his strength and speed in ways that made him faster than even Neji at full speed. That's partly why Neji and Tenten suspected he'd trained as a ninja somewhere, possibly the Land of Sound.
Content compiled by AnimeList.moe from publicly available sources.