To start studying topology, what basic knowledge should I have?
No prior knowledge is needed. But some mathematical maturity would be very helpful.
You should be comfortable manipulating sets, and you should have mathematical maturity.
For the rest there are not really prequisites, but I highly recommend to learn about metric space analysis first, which introduces concepts like open sets and closed sets etc.
Topology is a generalisation of this, so analysis is important for the motivation of the topology concepts.
Completely true and I basically agree with what you said. But there is a dark side of this moon. The example of metric spaces in mind, usually a Euclidean plane or sometimes a volume, can also be a burden learning topology, simply because metric spaces tend to be the "nice" topologies and there are a lot more which do not have those properties. I found it always a bit challenging to imagine spaces which e.g. aren't Hausdorff. So as basic as metric spaces are, and yes, they are indeed the origin of general topology, as obstructive they can be.
Thus there is no formal requirement to learn metric spaces first. It could as well be a good idea to start without them - without the prejudices they carry along. So the basic concept of sets and functions is strictly all one needs to learn topology.
my first analysis teacher george mackey told a story once, when this discussion came up, of how general the context should be for learning topology. he said a study showed there was no agreement on this point except for the fact that everyone agreed that one should learn the subject in whatever generality the respondent himself had learned it in grad school. so in keeping with this, i recommend learning metric space topology first, then learning general topology, say as in kelley. but i want to emphasize that as i learned at my own pain, one should study specific examples of non trivial topological spaces, such as spheres, lens spaces, compact surfaces not necessarily orientable, grassmannians, SO(3), SU(2), and more general examples constructed by "adding cells", i.e. cell complexes. to repeat, do not be satisfied at memorizing axioms for general topology without doing the harder work of mastering some actual examples.
Separate names with a comma.