How many connected components does have this set in $\mathbb{R} \times \mathbb{R}$? 
Definition. A metric space $M$ is connected if there is no other open disjoint $A$ and $B$ in $M$ such that $M=A\cup B$ than the empty set and the total space $M$. A subset $C\subset M$ is connected if the subspace $C$ is connected.
Definition. A connected component of $x\in M$ in a metric space $M$ is the union $C_x$ of all connected subsets of $M$ that contain the point $x$.

I want to know how many connected components does have the set 
$$
\{(x,y)\in\mathbb{R}^2:(xy)^2=xy\}
$$
I know it's the union of the axis $x = 0$ and $y = 0$ and the graph of the function $f(x) = 1/x$ (for $x\ne 0$), but don't know what to do with the definitions. Can someone help? 
 A: Hints: Consider these two subsets of the plane: A be the union of the axes and G be the graph you mentioned (the hyperbola).  Your space in question is $X=A \cup G$ endowed with the subspace topology from the plane. 
I will rely on the following background, which I assume you have covered already: what the connected sets of the real line are and that the line has only one connected component. 
Consider any point in $x$ on the x-axis, but not the origin. Any connected subset of $X$ that contains X must be of the form either $U=(I,0)$ where $I$ is an open interval of the real line excluding zero and including the x-component of the point $x$. Or of the form $Z=V \cap W$ where $V=(I,0)$ where $I$ is an open interval of the real line including x and zero and and $W=(0,I)$ where $I$ includes zero.  (Prove this by contradiction. Take any set not of the form $Z$ or $U$ that contains $x$ and immediately show it is not connected).
Then, all sets of the from $U$ or $W$ are subsets of $A$. Further, $A$ itself is a connected set containing x.  So A is a connected component containing x. Do a similar exercise for a point on the y-axis and a corresponding one for the origin. 
As for G, it is made up of two curves, one in the first quadrant $G_1$ and one in the third, $G_3$, each homeomorphic to the real line. So each of these is also a connected component. Since their union is the whole space X, you would have shown that A, $G1$ and $G3$ are the three connected components. 
Note 1:
While you can fill in the sketch above, my guess is that the real point of this exercise is that it is a bit tricky.  One may be tempted to answer that there is only one connected component because the graph come arbitrarily close to the axes. But you can show that A and the two parts of G are each open in the topology on X by finding an open set around any point in the component that does not intersect the other component. 
Note 2: a path connected space is connected. If you can use that fact, it’s very easy to show that A, $G_1$ and $G_3$ are path connected sets and therefore connected sets. I used the argument above here because of your interest in using that particular definition of components. To show that they are maximally connected (ie, they are components), though, it is not enough to show there are no paths between them. (As you know, lack of path connectedness does not imply lack of connectedness). You would use the open sets argument in Note 1 above. 
A: Clearly the union of the x and y axis is connected.
In addition { (x,1/x) : 0 < x } is connected.
Now find a curve that is asmytopic to both axis and
between the axis and 1/x. Such a curve can be used
to make a separation of the set being considered.
A: Sketch:
Let $A = \{(x,y) \, | \, xy = 0 \}$
$\; \; \; \;\,B = \{(x,y) \, | \, x \gt 0 \text{ and } y = x^{-1} \}$
$\; \; \; \;\,C = \{(x,y) \, | \, x \lt 0 \text{ and } y = x^{-1} \}$
$\; \; \; \;\,D = A \cup B \cup C$
Now $D$ is a subspace of $\mathbb R \times \mathbb R$.
Exercise 1: Show that each of the sets $A$, $B$, and $C$ are both open and closed  subsets of $D$.
Exercise 2: The topological space $D$ is the direct sum of $A$, $B$, and $C$.
Exercise 3: Each of the sets $A$, $B$, and $C$ are connected.
Proposition 1: Let $\{X_i : i ∈ I\}$ be a family of connected topological spaces indexed by $I$. Let
${\displaystyle X=\coprod _{i}X_{i}}$
be the disjoint union of the underlying spaces. Then the connected components of $X$ consists precisely of the summands $X_i$.
Proof: Exercise.
