How about $f\circ g$ and $g\circ f$ as linear transformations. Assume that $X$ and $Y$ are two vector spaces with dimensions of $2$ and $3$, respectively, and $f: X\rightarrow Y$ is a $1$-$1$ linear transformation and $g: Y\rightarrow X$ is an onto transformation. My questions are:
(1) Why $g\circ f$ is $1$-$1$ and onto.
(2) Why $f\circ g$ can not be $1$-$1$.
I am learning linear algebra and appreciate your answers in advance.
 A: In general, functions (and linear transformations are functions) can only maintain, or "shrink" the size of their domains when they map to the image. Functions never "blow up" the size of the set they map from (this is because every domain element only maps to a SINGLE image).
Now, the presence of vector addition in a vector space introduces a certain "uniformity" to the space. You can think of this in the following way:
The function: $L_u:V \to V$ which adds the vector $u$ to any vector $v$ (so $L_u(v) = u + v$) represents a "translation" by $u$, which happens "in essentially the same way" for any vector $v$. In particular, we can measure the "shrinkage" of a linear transformation, by checking "how much gets shrunk down to zero", because this "shrinkage factor" is applied "uniformly" across the entire space.
We measure the "size" of vector spaces by their dimension. This has the benefit of being able to describe much of the "character" of a given vector space by replacing it with a non-negative integer, and we understand integers pretty well.
So, for all practical purposes, knowing $g$ is onto, tells us that the dimension of the image of $g$ is $2$, and knowing $f$ is $1$-$1$ tells us the image of $f$ is of dimension $2$.
When we look at $f \circ g: Y \to Y$, we see that $g(Y)$ is of dimension $2$, and is ALL of $X$. So $(f\circ g)(Y) = f(g(Y)) = f(X)$, and since this has dimension $2$, and $X$ has dimension $3$, this cannot be ALL of $X$ (it's too small).
When we look at $g \circ f$, we can ask: "when is $(g \circ f)(x) = 0_X$?" (what's the shrinkage factor?). Unfortunately, this is going to depend on $g$ and $f$. For suppose $f(x) = y$, where $g(y) = 0_X$. Then $(g\circ f)(x) = g(f(x)) = g(y) = 0_X$, and if $x \neq 0_X$, this would mean $g \circ f$ is not $1$-$1$.
To see an example where this might actually happen, let $X = \Bbb R^2$, and $Y = \Bbb R^3$ (these have the right dimensions), let $f$ be the mapping $f(x_1,x_2) = (x_1,x_2,0)$ (this is $1$-$1$), and let $g$ be the mapping $g(y_1,y_2,y_3) = (y_2,y_3)$ (this is onto).
By direct computation, we see $(g \circ f)(x_1,x_2) = g(f(x_1,x_2)) = g(x_1,x_2,0) = (x_2,0)$. In particular:
$(g \circ f)(1,0) = g(f(1,0)) = g(1,0,0) = (0,0)$, and it is thus clear $g \circ f$ maps BOTH $(1,0)$ and $(0,0)$ to $(0,0)$ and is not $1$-$1$.
Furthemore, in this example, $\text{im}(g \circ f) = \{t(1,0): t \in \Bbb R\}$, which has the basis: $\{(1,0)\}$, and is one-dimensional, while $\Bbb R^2$ has dimension $2$, and thus the image of $g \circ f$ in this instance is also "too small" to be all of $\Bbb R^2$, so $g \circ f$ is neither onto, nor $1$-$1$.
So your statement (1) is untrue.
EDIT: As sometimes, happened, I answered the wrong question for (2). I apologize to the readers. I thought it said $g \circ f$ cannot be onto. I must remedy this. Fortunately, it turns out that with finite-dimensional vector spaces the two statements are equivalent, but I don't wish to go that route. So let's show we have to have two distinct elements of $Y$ that map to $0_Y$. One is clearly $0_Y$, by virtue of the linearity of $g$ and $f$, since:
$(f \circ g)(0_Y) = f(g(0_Y)) = f(0_X) = 0_Y$.
Now $g$ is onto, and $\dim(Y) = 3 > \dim(X) = 2$. We can't fit a $3$-dimensional space into a $2$-dimensional one, we must have some linear combination of the basis elements of some basis for $Y$ that become linearly dependent in $X$ (for if these were $b_1,b_2,b_3 \in Y$, and $g(b_1),g(b_2),g(b_3)$ were still linearly independent, then we would have $\dim(X) \geq 3$ which certainly is not true of the integer $2$).
So we have, say, $c_1,c_2,c_3$ not all $0$, with:
$c_1g(b_1) + c_2g(b_2) + c_3g(b_3) = 0_X$. Thus, if we take:
$y = c_1b_1 + c_2b_2 + c_3b_3$, we have:
$g(y) = g(c_1b_1 + c_2b_2 + c_3b_3) = c_1g(b_1) + c_2g(b_2) + c_3g(b_3) = g(0_Y) = 0_X$, that is:
$g$ maps both $y \neq 0_Y$ and $0_Y$ to $0_X$, and thus:
$(f\circ g)(y) = f(g(y)) = f(0_X) = f(g(0_Y)) =(f \circ g)(0_Y)$ with $y \neq 0_Y$ and $f\circ g$ is not $1$-$1$.
My apologies for this oversight (I blame my misspent youth, and advancing age).
A: (1). I don't think this is true...
(2). If $f\circ g$ were to be injective, then also $g$ must be injective. Since $g: Y \to X$ is onto, $\dim(g(Y)) = \dim(X) = 2$. This implies that $\dim(\ker(g)) = \dim(Y) - \dim(g(Y)) = 3 - 2 = 1$ by rank-nullity theorem. So $g$ has a nontrivial kernel and is not injective; thus $f\circ g$ is not injective.
A: Generally, considering $dim(X)=m$ and $dim(Y)=n$, when $m<n$, we can conclude that $f\circ g$ cannot be $1-1$. About $g\circ f$, it can be $1-1$ and onto, and as well may not.
