That's a vent pipe, it'll pull out towards the back of the car, maybe a slight wiggle rotationally needed to ease it out.
Wear safety googles when handling batteries.
Remove any shipping plug in the vent hole of your new battery, charge your new battery fully with your ctek when you get it ( motorcycle mode as it's quite a small battery )/
Put the red cover back on the battery in that's in the car.
Remove the two bolts holding the plate over the top of the battery, and lift the plate away.
Loosen the bolt a little on the negative terminal on the battery and pull the terminal off upwards, tuck it out the way/ put some cardboard or similar over it so it can't reconnect.
Pull the red plastic cover off again, and loosen that terminal, being VERY careful not to allow your spanner to touch the negative terminal on the battery!
Remove positive lead from the battery, and insulate it ( e.g thick plastic bag over it ), ( I don't think it's live but best to be on the safe side )
Lift the old battery out being careful not to short the posts with anything metal ( watch out for the aluminium rail over the top if you have a sportbrake ) - if your new battery came with terminal covers you could borrow one of them to put on the old battery.
Put the covers that came on the terminals of the new battery in place, and lift the battery in.
Remove the cover from the positive terminal, then refit the positive lead - the posts on the battery should stick out slightly above the terminals, so make sure it's pushed on properly before tightening. Then put the cover back on the positive lead.
Remove the cover from the negative terminal, and refit the lead.
Push the vent pipe in.
Put the plate back in place and bolt it down.
P.S.for safety you always disconnect the negative terminal first, and reconnect last, that way if you spanner were to touch the car when dealing with the positive terminal you're not creating a short circuit.
Then reset the BMS for the secondary battery.
I'm sure I made it sound difficult, but it's probably a 20min job at the most.