Can an irrational function be a utility function?
I don't particularly understand the question.
Start with any function $f:X \rightarrow \mathbb{R}$.
Define $x \succeq y$ if $f(x) \geq f(y)$.
We get a rational preference over $X$.
By the way $\sin(x) + 1$ is a perfectly valid utility representation.