Consider the function $f:\mathbb{Z} \rightarrow \mathbb{Z} $. Can I think of $f$ as the following 2-tuple $(\mathbb{Z},$ rule to map one integer to another integer$ )? $
And in the above sense, can I think about functions (and in general relations) as a type of mathematical structure?
That is almost correct. You can think of it as the 2-tupple $\langle \mathbb{Z} \times\mathbb{Z}, \text{rule to map one integer to another integer} \rangle $. The domain and codomain of a function can be different.
For example $f(n) = n^2 : \mathbb{Z} \to \mathbb{Z}$ would be $\langle \mathbb{Z} \times\mathbb{Z}, x \mapsto x^2 \rangle$