No that is not true, and it’s a point you seem unclear on. Please take a moment to engage with this point, it’s important.
A set is infinite if it can be bijected to at least one of its proper subsets. So the naturals are infinite because they can be bijected to the even naturals, or the odd naturals, or the primes, or (as Galileo noted in 1638) the perfect squares.
en.wikipedia.org/wiki/Galileo%27s_paradox
Likewise the reals are infinite because (0,1) is a proper subset and the tan/arctan functions biject the reals to (0,1). Or if you haven’t taken trigonometry, you can biject (0,1) to the set of positive reals via f(x) = 1/x.
Please I request that you spend some time to understand this point.
Now, bijecting the reals to the irrationals is a curiosity. I don’t need it to show the reals are infinite, the (0,1) examples already do that. But bijecting the reals to the irrationals is an interesting exercise, and shows how in general to get rid of a countable set within an uncountable one without altering the cardinality of the uncountable set.
So, here’s a function that maps the reals to the irrationals.
First, the rationals are countable so they may be placed into an order like this: (q_1, q_2, q_3, \dots)
Now we need to choose any countable sequence of irrationals. It doesn’t matter which one we choose, but for definiteness let’s pick the sequence (\pi, 2 \pi, 3 \pi, 4 pi, \dots)
We define our function (f(x)) as follows. If (x) is rational, it’s one of the (q_n)'s.
We map each rational (q_n) to (2 n \pi). That is, we map (q_1) to (2 \pi), (q_2) to (4 \pi), and so forth.
If (x) is irrational and one of the (n \pi)'s, we map it to ((2 n - 1) \pi). For example (\pi) goes to (\pi), (2 \pi) goes to (3 \pi), etc.
Finally, if (x) is anything else – that is, if it’s irrational and not one of the (n \pi)'s – we map it to itself.
If you think this through (and I don’t claim that’s easy, this takes some work), you will see that we have a bijection between the reals and the irrationals.
This proof is due to Cantor. He used the irrational sequence (\frac{\sqrt 2}{2^n}) in order to show a bijection between the unit interval of reals and the irrationals in the unit interval.
See this thread for several variants. The example I showed is based on the answer by MJD (fifth and final answer on the page). math.stackexchange.com/question … -irrationa
Again, please note that showing the reals are an infinite set does not depend on this somewhat complicated example. We know the reals are infinite because we may biject them to (0,1), a proper subset of the reals. But if you ever need to show that there’s a bijection between an uncountable set and that same set minus some countable set, this is the construction to use.