Continuous function that takes rationals to irrationals and vice-versa? In this question - https://www.quora.com/Can-you-create-a-continuous-function-that-takes-rational-numbers-to-irrational-ones-and-vice-versa
How $|f(\Bbb{Q})| \leq |\Bbb{Q}|$ ? in the first answer, I understood that $|f(\Bbb{Q}^c)| \leq |\Bbb{Q}|$ de to the fact that $|$Codomain$| \leq |$range$|$.
After that how do I think of this? - It then follows that f is a constant function because a non-constant continuous real-valued function has an uncountable image.
Also any other approach to this question?
 A: You probably meant it the other way : the codomain is always larger than the range above.
Anyway, for a function, it can map every value in the domain to only one value in the range (that is, $f(x)$ is a unique value in the range), so in fact the range is also smaller than the domain . That is what the first statement reflects, since the domain is $\mathbb Q$ and the range is $f(\mathbb Q)$. 
The other fact follows from the intermediate value theorem : if two distinct points $a < b$ are in the range of $f(\mathbb Q)$, then the entire range $[a,b]$ must belong to the range, by the fact that $f$ is continuous and hence the intermediate value theorem holds. it turns out that $[a,b]$ is uncountable if $a \neq b$, so $f(\mathbb Q)$ cannot contain two distinct points if it is countable: from here, $f(\mathbb Q)$ must be a single point, so $f$ is constant.

Clarification on "domain larger than range"
The first thing that one shouldd keep in mind, especially with infinite sets, is that an infinite set may possibly have the same size as one of its subsets. 
For example, $\{1,2,3,...\}$ is of the same size as $\{2,3,...\}$, because we have a bijection between the sets, given by the map $x \to x+1$. So, even though one set is contained in the other, they have the same size.
There is a way to look at the range as a "subset of the domain" : here's how we do  it . Fix any $x$ in the range. By definition of the range, there is a $y$ in the domain which maps to $x$.
As $x$ varies over the range, collect all the $y$s and put them together to form a subset of the domain. The point is, any two different $x$ s must be associated to different $y$ s, because $f(y)$ has a unique value, so $y$ cannot be associates to two different values. 
This subset of the domain is at least as large as the range, because for each point of the range we found a different point in the domain to associate to. However, the domain itself is at least as large as this subset, and therefore as large as the range.
All this, completely ignores containment. Which means it is entirely possible that as sets in their own right, the domain is actually strictly contained in the range. What matters for us is the cardinality i.e. the size of both sets, and for this parameter I have shown that the domain is at least as large as the range in size, even though it may be contained in it.
