K, let's go through all your questions one at a time.
>If I breed the changed nature ones will the offspring be good to use?
As good to use as it's parents. It's possible to breed two illegally obtained Pokemon to get a legit Pokemon, as long as it still has a legal moveset and ability. If not then this Pokemon is also considered illegal, although the game itself can't do much about it.
>Will the game find out I was using cheat codes?
The game itself won't really find out; even if it does the game doesn't really do much about it.
>What if I use the offspring for world's next year? Would it be smart for me to do that?
That isn't possible. When you enter a Pokemon to any competition, your Pokemon are thoroughly inspected. If you are caught using illegal Pokemon you are straight up disqualified. However, if this bred Pokemon has a legal moveset and ability, it won't be considered hacked and will be allowed.
As for whether it's smart or not, many people actually do hack in their Pokemon. Although most are legendary Pokemon. When they do so, they make sure it looks completely legal.
NOTE: Just a general doubt I wanted to clear. When you hack in a Pokemon or moves / abilities / IVs / EVs etc onto a Pokemon, it is considered hacked. However, when you breed this Pokemon and get a legal-looking offspring, it is considered by the game, not hacked. I don't really encourage this, but it's a common practice among competitive players to hack their Pokemon and then use them.
Hope I helped!