Assigning integer to finite CW complex such that following hold. For each $n \in \mathbb{Z}$, is there a unique function $\varphi$ assigning an integer to each finite CW complex, such that the following hold?


*

*$\varphi(X) = \varphi(Y)$ if $X$ and $Y$ are homeomorphic.

*$\varphi(X) = \varphi(A) + \varphi(X/A)$ if $A$ is a subcomplex of $X$.

*$\varphi(S^0) = n$.

 A: Yes. Of course, such a function exists; let $\varphi_n(X) = n\tilde{\chi}(X)$, where $\tilde{\chi}$ is the reduced Euler characteristic. Your property 2 follows from the reduced homology long exact sequence.
Call a function of your kind $\varphi_n$. 
1) $\varphi_n(A \vee B) = \varphi_n(A) + \varphi_n(B)$. You can always subdivide the CW structures on $A \vee B$ so that their wedge is a CW complex with $A$ and $B$ given as subcomplexes. Then $B = (A\vee B)/A$.
2) $\varphi_n(S^k) = (-1)^kn$. This follows because if $S^{k-1} \subset S^k$ is the equator, then $S^k/S^{k-1} = S^k \vee S^k$. So $\varphi_n(S^k) = \varphi_n(S^{k-1}) + 2\varphi_n(S^k)$. So $\varphi_n(S^k) = -\varphi_n(S^{k-1})$.
3) Let $X^k$ be the $k$-skeleton of $X$. Suppose we know that for CW complexes of dimension at most $k$, $\varphi_n(X) = n\tilde{\chi}(X)$. Then if $X$ is of dimension $(k+1)$, $\varphi_n(X) = \varphi_n(X^k) + \varphi_n(\vee_\ell S^{k+1}) = (-1)^{k+1}\ell n$, where $\ell$ is the number of $(k+1)$-cells in $X$. But the reduced homology is precisely the same as the alternating sum of the number of cells in each dimension, minus one. So the result follows.
