I'm trying to show that the cardinality of any variety of positive dimension is $ |k |$ where $k $ is the field being considered. This is part of exercise I.4.8 in Hartshorne's Algebraic Geometry:
Show that any variety of positive dimension over $k $ has the same cardinality as $ k $. Hints: Do $\mathbb{A}^{n} $ and $\mathbb{P}^{n}$ first. Then for any $ X $, use induction on the dimension $ n $. Use (4.9) to make $ X $ birational to a hypersurface $ H \subset\mathbb{P}^{n+1 }$. Use (Ex. 3.7) to show that the projection of $ H$ to $\mathbb{P}^{n}$ from a point not on $ H$ is finite-to-one and surjective.
So far I successfully showed this result for $ \mathbb{A}^{ n} $ and $ \mathbb{P}^{ n} $. For the general case, since $ X$ sits in a projective space, we have $|X | \le | k| $. To show the opposite inquality, $ X $ has an affine open subset $ U $of positive dimension. Hence there is a nonconstant polynomial as a regular function on $ U $. If I show that this polynomial is surjective, I'm done. I'm unable to show this so far.
I'm interested in completing my approach. If it's hopeless or too difficult, I'm fine with a solution following the hint of the book.
Thank you