The basics of jigsaws and their blades:
Jigsaws cut as you push them. Normally you will be starting the cut close to you, and pushing it away from you as the blade makes the cut; be aware if you're making a cut that is longer than your reach that you may have to stop and change position mid-cut, or adopt a different posture and walk the saw along the cut.
Make sure the saw is at full speed before you begin cutting.
Most blades intended for cutting wood cut on the upstroke (the teeth point upwards), and this can lead to splintering on the upper surface. The simplest way to reduce this is probably to apply masking tape along the cut line, burnish it down well and saw right through it; when you're done, peel off the tape carefully to avoid lifting flakes.
Coarse blades cut faster, but leave a ragged surface. Finer blades with more teeth cut more slowly but leave a much better surface and there is less splintering. 10tpi blades may be the sweet spot.
Regardless of the number of teeth let the saw do the work. In other words, cut slowly. Forcing cuts using a jigsaw is probably the number one source of frustration for inexperienced or impatient users. Pushing the saw into the cut with force leads to rougher sawn surfaces, worse splintering and additionally the blade is likely to flex in use leading to the cuts not being square to the face.
Jigsaws can be quite loud, it would be best to plug your ears or wear earmuffs.
For lots more guidance see these:
Jigsaw BASICS for Beginners. from DIYForKnuckleheads.
How I made my jig saw cut a LOT better from Stumpy Nubs.
Shortening the shelves
The simplest way for someone with no workbench to cut boards to length is just to rest each one across the seats of two matching chairs1, kneel on the wood and saw off the projecting part.
If you're a right-hander the projecting end should be to your right. If you're a leftie it should be the other way around.
Practice makes perfect. If you feel it is necessary you can make multiple practice cuts on the material you know will be cut off before sawing your shelves to finished length.
Cutting the MDF to size
It's perhaps more difficult to arrange to cut the MDF, but it is generally possible in an apartment setting using the furniture available and some ingenuity.
The best way is probably to cut with the MDF on a table or desk, obviously with the portion to be cut well off the edge of the supporting surface so there's no chance your cut can wander into the tabletop. You can do this quite conveniently on a low coffee table, but you can successfully make your cuts on a table of any height.
If your table isn't low enough to kneel on, clamping the MDF in place would be ideal (and the clamps would have many future DIY uses). If you don't want to invest in a couple of clamps, heavily weight the part of the sheet that rests on the table, for example with numerous heavy books, so it can't easily move2.
Because your rectangle of MDF will be out of sight once mounted at the back of your desk your cuts don't have to be perfect by any means. So instead of trying to saw along a straightedge to guide the jigsaw I suggest you just guide it freehand to the best of your ability, following a pencil or ballpoint pen line, and don't sweat it if your cuts are irregular.
1 You can do it on a single chair, but you have to be more careful as there's a greater tendency for the wood to shift as you're cutting it.
2 If you have any non-slip drawer lining material definitely put some under the MDF as well.