Prove that $\dim(U) - \dim (V) + \dim(W) - \dim(X) = 0$ The question tells us that $U,V,W,X$ are finite dimensional vector spaces and $f,g,h$ are linear functions. It also says that
$$U \xrightarrow{f} V \xrightarrow{g} W \xrightarrow{h} X$$
with $f$ injective, $h$ surjective, $\operatorname{range}(f) = \operatorname{nullspace}(g)$, and $\operatorname{range}(g) = \operatorname{nullspace}(h)$.
I think I'm oversimplifying it, but wouldn't it make sense that if $V$ (being the range of f) is the null space of $g$, wouldn't the function $W$ be trivial? Thus making $X$ also trivial and $\dim(W)= \dim(X) = 0$?
This is all I have so far, and I'm not sure how I'd go about finding the dim(U) at all honestly.
 A: Hint: If $f:U\rightarrow V$ is a linear mapping, then
$U/\ker (f)$ is isomorphic to $im(V)$ and so $\dim U = \dim\ker(f) + \dim im(V)$.
A: using rank-nullity thm 3 times,
$\dim(U)=\dim(ker(f))+\dim(im(f))$
$\dim(V)=\dim(ker(g))+\dim(im(g))$
$\dim(W)=\dim(ker(h))+\dim(im(h))$
f is injective $\implies ker(f)=\phi$
h is surjective $\implies im(h)=X$
$\dim(U)-\dim(V)+\dim(W)-\dim(X)$
$=\dim(ker(f))+ (\dim(im(f))-\dim(ker(g))) + (-\dim(im(g))+\dim(ker(h))) + (\dim(im(h))-\dim(X))$
$=\dim(\phi)=0$
to address OP's claim "... $\dim(W)=\dim(X)=0$", this is not true. one counterexample is let all the vector spaces be $\mathbb R$ , f and h be identity maps , g be the zero map. then f and h are bijective, $im(f)=\mathbb R=ker(g)$ and $im(g)=0=ker(h)$.
note: $U \xrightarrow{f} V \xrightarrow{g} W \xrightarrow{h} X$ is an exact sequence.
special case of Dimensions of vector spaces in an exact sequence
A: Let $u_1, \dots, u_p$ be a basis of $U$.
By injectivity of $f$, $f(u_1), \dots, f(u_p)$ are linearly independent in $V$. So there is a basis $v_1, v_2, \dots, v_q$ of $V$ where $f(u_1) = v_1, \dots, f(u_p) = v_p$.
Because the range of $f$ is the nullspace of $g$, $g(v_1) = \dots = g(v_p) = 0$, and $g(v_{p+1}), \dots, g(v_q)$ are linearly independent in $W$. So there is a basis $w_1, w_2, \dots, w_r$ of $W$ where $g(v_{p+1}) = w_1, \dots, g(v_q) = w_{q-p}$.
Because the range of $g$ is the nullspace of $h$, $h(w_1) = \dots = h(w_{q-p}) = 0$, and $h(w_{q-p+1}), \dots, h(w_r)$ are linearly independent in $X$. Because $h$ is surjective, $h(w_{q-p+1}), \dots, h(w_r)$ form a basis of $X$. Therefore the dimension of $X$ is $r-(q-p) = \dim(W) - \dim(V) + \dim(U)$.
