How are real income and utility the same thing? The textbook I'm using, &quot;Microeconomic Theory: Basic Principles and Extensions&quot;, treats utility and real income as the same thing in the chapters on compensated and uncompensated demand. I would like to understand the logic behind it. To me real income always meant &quot;Nominal Income/CPI&quot; but I don't think this can also be translated to utility.
Real income and utility are not the same thing but utility can be expressed as a function of income because income is what allows you to consume goods and services.
For example, let us assume there are only two goods $x_1$ an $x_2$ and consumer is given budget $p_1 x_1 + p_2 x_2 = m$, where $p_i$ are prices for good 1 and 2 respectively and $m$ is an income.  Let us assume Cobb-Douglas utility function:
$$ u(x_1, x_2) = x_1^\alpha x_2^{1-\alpha}$$
Here after solving the consumer optimization problem we would get optimum consumption of $x_1$ and $x_2$ as (I skipped the steps but you can easily derive it by setting up an Lagrangian):
$$x_1^*= \alpha \frac{m}{p_1};x_2^* = (1 -\alpha) \frac{m}{p_2}$$
Consequently, given optimal consumption of $x_1^*$ and $x_2^*$ is:
$$u(x_1^*, x_2^*) = \left( \alpha \frac{m}{p_1} \right)^\alpha \left((1 -\alpha) \frac{m}{p_2} \right)^{1-\alpha} $$
So the utility will end up being function of nothing else than a function of income $m$ an prices $p_1$ ($\alpha$ is just parameter). A utility function expressed in terms of prices and income even has its own special name 'indirect utility' typically denoted as $v$ (e.g. $v(\textbf{p},m) =\max u(\textbf{x})$ such that $\textbf{px} = m$ see Varian Microeconomic Analysis 3rd ed pp 99.)
Consequently as shown above utility does depend on income. Utility is generally not equal to real income, and I don't have the copy of the textbook you mention and you did not gave us the page for that claim, but they might have just used a utility function where utility would be proportional to real income. For a didactic purposes even assuming $v(m,\textbf{p})=\frac{m}{\textbf{p}}$ can be reasonable depending on setting even if it is not realistic because it simplifies calculations for novices (e.g. supply and demand are also typically not linear but your textbook likely draws them as linear functions).