The definition of continuous function in topology I am self-studying general topology, and I am curious about the definition of the continuous function. I know that the definition derives from calculus, but why do we define it like that?I mean what kind of property we want to preserve through continuous function?

If you mean the definition that $f\colon X\to Y$ is continuous if $f^{-1}(U)$ is open for every open $U\subseteq Y$, then this is because this property is equivalent to continuity in metric spaces, but doesn't refer to the metric. This makes it a natural candidate for the general definition.
It is a little harder to motivate the definition in terms of the preservation of properties, because we have to do it backwards. We are saying that a function $f$ is continuous if $f^{-1}$ (thought of as a function from the set of subsets of $Y$ to the set of subsets of $X$) preserves the property of openness. We run into problems if we try to insist that $f(U)$ is open for every open $U\subseteq X$ (maps with this property are called open), because the image function from subsets of $X$ to subsets of $Y$, taking a subset $V$ to the subset $f(V)$, doesn't respect the operations of union and intersection in the same way that $f^{-1}$ does. For example, $f^{-1}(U\cap V)=f^{-1}(U)\cap f^{-1}(V)$, but it is not true in general that $f(U\cap V)=f(U)\cap f(V)$. As the definition of a topology involves certain intersections and unions preserving the property of openness, any "structure preserving map" must do so as well, which is why we consider $f^{-1}$.
