Those closest to God share God's experience. Hosea, standing in the position of God's representative to the people of his generation, took up the burden of loving a woman seemingly unworthy of his love. God led him to this course because God was in a similar position, loving his "wife" Israel despite her infidelity. God suffered because of Israel's faithlessness, and by marrying a wife who would not be faithful, Hosea showed God's "steadfast love" for his people. In so doing, Hosea also demonstrated his own attitude of complete obedience to God.
The OP asks: "What was this helpful for?" This is what @Dottard called an "enacted parable," but it was enacted as a most profound level. It provided an deeply moving example of God's love, a love which will ultimately prevail no matter what. Thus God promises Israel through the prophet:
“And it shall be at that day,” saith the Lord, “that thou
shalt call Me ‘Ishi’ [that is, My husband], and shalt call Me no more
‘Baali’ [that is, My Lord]. (Hosea 2:16)
This prophecy has a double meaning: Israel will turn away from the baals, and she will also no longer relate to God as a lord or master (based on law), but as a husband (based on love). The ultimate purpose of Hosea's course is to provide a dramatic example of redemption. As Hosea's unconditional love for his wife will eventually redeem her, so God will redeem his wayward people.
Lo-Ruhamah
About the tragic name given to Hosea's daughter (Lo-Ruhamah, meaning "not loved" or "not pitied") I would make two points: First, tragic names are more common than one might think. Ainsley means "alone." Claudia means "crippled." Dolores mean "pains/sorrow." Miriam and Mary are related to "bitterness." Secondly, we should consider that many OT figures had both a symbolic name and a common name. Although the prophet Nathan named David's second son Jedediah, he is known to history as Solomon. Although an angel told Joseph that his son would be known as Emmanuel, in everyday life he was called Jesus. Therefore, Lo-Ruhamah would not necessarily what her parents normally called her. Indeed, in the next chapter, God is quoted as saying:
I will sow her for myself in the land,
and I will have pity on Not-Pitied. I will say to Not-My-People, “You are my people,”
and he will say, “My God!”
Thus, God gave these negative symbolic names to show that his love would prevail absolutely. He expected Gomer and Hosea to show unconditional love to their children. In so doing they undoubtedly had the freedom to give them pet names for everyday use that would demonstrate that they were were indeed loved and accepted by their parents. If God can "have pity on Not Pitied" then her parents can lovingly play with he name as well. I like to picture them calling her simply "Ruhamah" ("mercy") or perhaps shortened version of this word as a nickname. One might think of a Dolores (literally "sorrows" in Spanish) being called Dolly or Lola.
Conclusion: God asked Hosea to walk a suffering path to bring him closer to God's heart and show the people of Israel an example of his absolute love for them. The tragic names given to the prophet's children were not meant to be permanent and were probably not used for them in everyday life.