How does the properties of domain and codomain imply about the properties of the function? The question comes up when I'm considering the following issue

For $f:A\to B$, give only some of the properties of the sets $A$ and $B$, what can we say about $f$?

The first thing came to my mind that I want to say about $f$ is whether it is injective or surjective (Notice that we are given only $A$ and $B$!). Well it is not difficult to conclude the following:

$$(\mathrm{card}(A)\gt\mathrm{card}(B))\implies(f \text{ is not injective.})$$

Notice that $\gt$ above means "strictly greater than". The argument is to say, for example, all functions $f:\mathbb R\to\mathbb Q$ must not be injective. It is not hard to prove so I leave it alone. Now, using similar method, I got:

$$(\mathrm{card}(A)\lt\mathrm{card}(B))\implies(f \text{ is not surjective.})$$

Say, for an example, $f:\mathbb Q\to\mathbb R$ must not be surjective.
But another problem come up here: if I want to find two sets, $A$ and $B$, such that $f:A\to B$ must be not subjective nor injective,

(a) Do they exists?
(b) If so, what are they? If not so, how to prove it in a formal way?

Despite the general set properties of it, if we fix some properties, say for example, we could also get, as a well-known result:

For a linear map $T:V\to W$, where $V$ and $W$ are vector spaces, we have $\mathrm{rank}(T)+\ker(T)=\dim(V)$

And a more generalized problem is here, say that

How does the topological, algebraic, or other properties of the domain and codomain imply about the properties of the function?

 A: For the first part, it is a matter of definition. A set $A$ is said by definition to have cardinality at most the cardinality of $B$ if there is an injective map $f:A\to B$. Given two non-emtpy sets $A$ and $B$, the axiom of choice ensures that their cardinalities $\mathrm{card}(A)$ and $\mathrm{card}(B)$ are totally ordered, i.e. 
$$
\mathrm{card}(A)\ge\mathrm{card}(B)\qquad\text{and/or}\qquad\mathrm{card}(A)\le\mathrm{card}(B).
$$
By definition this means that either there is an injection $A\to B$, or $B\to A$ or both, and the last case corresponds to a bijection $A\leftrightarrow B$ via the CSB theorem. Note that again, an injection $B\to A$ implies the existence of a surjection $A\to B$.
So, No. There will always be an injection/surjection from one of your sets to the other one (if not even in both direction), as long as you work in the general setting of ZFC. You cannot prevent injectivity and surjectivity by a clever choice of domain and codomain.
The only exception (as pointed out in the comments under your question) is when choosing the domain $A$ to be non-empty and the codomain $B=\varnothing$. In this case no $f:A\to B$ exists at all.
