Would magnets still function in space or do they need the north/south magnetic poles?
They have north/south magnetic poles. They don’t need anyone else’s poles.
I think you may be confused because the geographic terms ‘north’ and ‘south’ are used to describe magnetic poles. The only reason this is so is that the earth itself is a magnet, and leads to the fact that magnets will align themselves with the earth’s field. The ‘north pole’ of a magnet will point north, while the ‘south pole’ of a magnet will point south. It has nothing to do with a quality of the earth that makes magnets work.
This gives you the interesting bit of trivia that the North Magnetic Pole of the earth is a ‘south pole’, since opposite poles attract.
But I digress. The magnets work just fine in space, and can attract other magnets and materials such as steel. I believe I’ve seen video of astronauts playing with magnets, making them ‘orbit’ each other.