Chain going "slack" on the 7th gear under load on a new mountain bike?
Does the bike have multiple chainrings? Make sure you aren't cross-shifting- that is, shifting into a gear that is too high/low for the chainring that the chain is sitting on. This can cause a problem like you've described- chain rubbing on front derailleur and constantly attempting to shift to put the chain into a more linear position.