I was thinking about the trivial topology, in which the only open sets are $X$ and $\emptyset$, where $X$ is the entire space we are working in.
My doubt is: are all the subset of $X$ compact and connected? I understand that they are all closed, since the only open sets are $X$ and $\emptyset$. But compact means also bounded, so if for example $X = \mathbb{R}$, how can be, for example, $(1, +\infty)$ bounded?
Also I'm having problems in understanding connectedness. Say we have $[1, 3]\cup [4, 6]$, how is this connected in the trivial topology?
"... compact also means bounded ..." is true in a metric space, where the concept of bounded is defined. But in a topological space where no metric is defined, boundedness is undefined. So you have to adjust your intuition here so as to entirely ignore the concept of boundedness in approaching this problem. Instead, you have to directly apply the definition of compactness.
Compactness, by definition, says every open cover has a finite subcover. Well, in the trivial topology there are only 2 open sets, namely the empty set and the whole space. So, any given open cover is already finite, because that open cover has at most 2 elements. The space is therefore compact.
Disconnectedness, by definition, says that there is a disjoint pair of nonempty open sets whose union is the whole space. Well, in the trivial topology there is only 1 nonempty open set, namely the whole space. So there does not even exist two nonempty open sets (let alone two which are disjoint and whose union is the whole space). So the space is not disconnected --- that is to say, it is connected.