Cohomology of resolution of singularity

In general, the answer is no. It already fails for a nodal curve. In fancier terms, you can understand the obstruction as follows: if $X$ has a resolution $\tilde X$, and the cohomology of $X$ injects the cohomology of $\tilde X$, then $H^i(X)$ would be pure of weight $i$ as a Galois module/mixed Hodge structure (when over $\mathbb{C}$).


Given a resolution $\pi:\tilde X \to X$, you can ask whether the pullback morphism $\pi^*:H^k(X) \to H^k(\tilde X)$ is injective for some (or all) $k$. As Donu points out, the mixed Hodge structure on $H^k(X, \mathbf C)$ would be pure which is a restrictive condition. One case where this is true for all $k$ is when $X$ has at worst quotient singularities by a result of Steenbrink. For orbifolds, $H^k(X) \cong IH^k(X)$ for all $k$, where $IH^k(X)$ is the intersection cohomology, so we have the injection again by David's comment. Another example for a specific $k$ is for rational singularities, i.e., $R^i\pi_*\mathcal O_{\tilde X} = 0$ for all $i > 0$. By playing around with the Leray spectral sequence, it follows that $\pi^*$ is injective for $k \le 2$ (although I think $H^1(X)$ is pure for normal singularities by the same logic). In general $H^2(X)$ and $IH^2(X)$ are not isomorphic for rational singularities. You can see this by taking a scheme with a isolated rational singularity which is not $\mathbf Q$-factorial.

However, there is always a map $H^2(X) \to IH^2(X)$ which will be injective if $H^2(X)$ carries a pure Hodge structure. More generally, any injection $H^k(X) \hookrightarrow H^k(\tilde X)$ will factor through the injection $IH^k(X) \hookrightarrow H^k(\tilde X)$ coming from the decomposition theorem (at least for proper schemes).