Let $X,Y$ be CW-complexes with $X$ finite dimensional and $X = \bigcup_{n \in \Bbb N} X_n$ where the $X_n\subset X_{n+1}$ are finite sub-complexes of $X$. If $f: X \rightarrow Y$, with $f|_{X_n}$ null-homotopic is $f$ necessarily null-homotopic?
EDIT: Please do not downvote existing answers as I had forgotten to include the assumption $X_n\subseteq X_{n+1}$
There are examples of fantom maps from finite-dimensional CW-complexes, see for instance
C. McGibbon, Phantom maps. In: I. James (ed), "Handbook of algebraic topology", pp. 1209-1257.
The examples themselves appear on page 1212. The space $X$ is the mapping telescope of a sequence of maps $S^n\to S^n$ whose degrees are coprime to a fixed prime $p$. McGibbon refers to these examples as "fantom maps of the 2nd kind". For the purpose of the question, these are maps which are not null-homotopic, whose restrictions to each finite subcomplex is null-homotopic.
Edit. Here is a useful theorem:
For a CW complex $X$ and a number $n$ we define the subgroup $Fantom^n(X)< H^n(X)$ to consist of (fantom) cohomology classes whose restriction to each finite subcomplex in $X$ is trivial.
Theorem. $Fantom^n(X)\cong Ext^1(H_{n-1}(X)/Torsion, {\mathbb Z})$.
See Infinite CW-complexes, Brauer groups and phantom cohomology, page 2.
Thus, one can construct a space with nonzero 2nd fantom cohomology by taking, for instance, a space with $H_1(X)\cong {\mathbb Q})$ (since $Ext^1({\mathbb Q}, {\mathbb Z})$ is enormous, isomorphic to ${\mathbb A}/{\mathbb Q}$, where ${\mathbb A}$ is the group of adeles). The space $X$ can be taken 2-dimensional, a presentation complex for the additive group of rational numbers.
To get from fantom cohomology to fantom maps, look at $[X, K({\mathbb Z}, 2)]$.