This could be a clutch problem.
Try, with the engine running but car stationary handbrake on - press the clutch down move through each gear position holding the clutch pedal down all the while.
If this goes OK, then do same again but gently release the clutch in each gear you should feel the engine begin to slow as the clutch starts to engage, as soon as it slows press hard down again and move onto next gear, and so on.
If this test goes OK then clutch and gearbox are working.
If the above fails - if you bought the car from a dealer take it back, and tell there is a problem with the clutch or gearbox, and you want it fixing under warranty.
If you bought it privately, and were not told about the problem, ask for your money back.
If the above is OK, then perhaps you need some practice - find a quiet road, and practice gear changing both up and down.