Let $A\neq \emptyset\neq B$ be sets, $C\subseteq A$, $D\subseteq B$ subsets and $f:A\rightarrow B$ a map.
I want to show that the set $\{f^{-1}(\{x\})\mid x\in\text{im} f\}$ is a partition of $A$.
$$$$
For that do we have to show that the union of all such sets is equal to $A$ and the intersection of them is the empty set?
Could you give me a hint how we could do that?
For "the union of all such sets is equal to A" you need to use the definition of the Domain of a function f. Try starting with $ a \in A$ and find a set of the form $ f^{-1}(\{x\}) $ that contains a.
For "the intersection of them is the empty set", assume that for $ x_1 \ne x_2 $ you have $ a \in f^{-1}(\{x_1\})$ and $ a \in f^{-1}(\{x_2\})$. Is this consistent with f being a function?
As a side note, although it is not wrong, you are using x to refer to the images of f. I think $ f^{-1}(\{y\}) $ would be clearer.