How do i solve
$$\int^a_{-\infty}\frac{1}{\sqrt{2\pi}}e^{-\frac{z^2}{2}} \, dz = 0.005\text{ ?}$$
I thought of using the substitution $z = 1/x$ which gets me to
$$-\frac{1}{\sqrt{2\pi}}\int^{\frac{1}{a}}_0\frac{1}{x^2}e^{-\frac{1}{2x^2}} \, dx = 0.005$$
But i have no idea how to solve it.
You don't. This is a classic example of something that you "solve" by tables, graphically, or by numerical methods.
By table, we work from this standard normal table, which is a one-sided, right-sided table, so we want to find $\frac{1}{2} - 0.005 = 0.495$ in this table and then negate it. We see that the cumulative value of $0.495$ occurs between $Z = 2.57$ with $0.49492$ and $Z = 2.58$ with $0.49506$. Linearly interpolating, we have $0.495$ when $Z = 2.5757$, so your value of $a$ is approximately $-2.5757$.
By graph, we can use many different methods. For instance, from a left-tailed log-linear plot of the CDF, its height is $0.005$ when $a$ is very slightly greater than $-2.6$.
Numerically, we proceed by unbounded binary search, then bisection. We start by evaluating your integral at $a = 0$ by symmetry, giving $1/2$. Since the value of the integral you want is in $(0,1/2)$, we proceed in the interval $a \in (-\infty, 0)$. \begin{align*} a && \text{test} && &\text{value} \\ (-\infty,0) && -1 && 0.&15866 \\ (-\infty,-1) && -2 && 0.&022750 \\ (-\infty, -2) && -4 && 0.&000\,031\,671 \\ (-4,-2) && -3 && 0.&001\,350 \\ (-3,-2) && -2.5 && 0.&006\,209\,7 \\ (-3,-2.5) && -2.75 && 0.&002\,979\,8 \\ (-2.75,-2.5) && -2.625 && 0.&004\,332\,5 \\ (-2.625,-2.5) && -2.5625 && 0.&005\,196\,1 \\ (-2.625,-2.5625) && -2.59375 && 0.&004\,746\,8 \\ \end{align*} Stopping here, because we've adequately demonstrated the method. We can do two things. First, we know that the desired value of $a$ is between $-2.59375$ and $-2.5625$ and we could halve the size of this interval as many times as needed to meet an accuracy goal by further rounds of bisection. Alternatively, we could linearly interpolate over the tiny interval left to get a "sharper" final number: $a$ is approximately $-2.5761$.
Now, in the late $20^\text{th}$ and early $21^\text{st}$ centuries, we can use computer algebra systems to compute your $a$ to arbitrary precision. Much theoretical and numerical technology has been brought to these systems. Mathematica 11.2 finds that your integral is $\frac{1}{2} \left(1 + \mathrm{erf}(a/\sqrt{2})\right)$, and that this inverts to $a = \sqrt{2} \,\mathrm{erf}^{-1}(2z-1)$ (where $z$ is the $Z$ score), and then evaluating this with $z = 5/1000$ to $20$ decimal places, we get $a = -2.575\,829\,303\,548\,900\,760\,97\dots$ where the elided digits would round the last digit shown up to $8$. You may imagine this number was found by further bisection, but this has been augmented with machinery to control loss of precision/accuracy and other defects of numerical calculations. (For instance, many specific transcendental functions, like $\mathrm{erf}$ and its inverse have efficient evaluation techniques, which we have ignored.) Research in this machinery is still ongoing.