Say $f(x)$ is defined as $f(x) \equiv x+1\pmod m$. My notes say that $f(x)$ has domain $\{0,\ldots, m-1\}$ based off of this definition, and that all of its outputs are mapped here too. However, I am not seeing how $\{0,\ldots, m-1\}$ is the domain based off of just the above definition of $f$, and am altogether unsure of how to inteprret its definition. I would assume that its domain is all real numbers, (or some other universal quantification over a large set like this) and given a number $x$, it outputs a number such that it is congruent mod $m$ to $x+1$.
Also, I am not seeing how its output must be in $\{0,\ldots, m-1\}$; it seems its output is merely defined to be congruent to numbers in that set in that it differs by a multiple of $m$ to any numbers in that set, but could be any real number. How should I interpret this definition, and how is it the case that $f(x)$ has both domain and codomain $\{0,\ldots, m-1\}$?
EDIT: my course notes go on to say that "the unique pre-image of $y$ is $y-1$", with reference to $f$. How could this be the case when $y$ could be $0$ and $x$ could be $m-1$?