According to the domain's Wikipedia page
I can express the domain and range of a function like this $$f:X\rightarrow Y$$
What if I am only interested in the domain of the function? Is it mathematically accepted to write this? $$f:X$$
What if I am only interested in the range?
I am asking if there is a mathematical notation to represent these concepts individually without presenting both at the same time.
One often sees $\operatorname{dom }f$ and $\operatorname{ran} f$ or $D(f)$ and $R(f)$ or $D_{f}$ and $R_{f}$ .
Of course, you can also say something like
or whatever. You're allowed to make up whatever notation you like, as long as you explain it clearly.