It can be done, but involving active systems on a scale far beyond anything humanity has ever done, cost estimates are not possible.
AlexP is right that there's nothing remotely strong enough to build it out of. No passive structure can reach anywhere near space.
However, active structures do not have this limit. The simplest approach is to build your tower around an incredibly powerful space fountain. The base of your tower is bunch of linear motors that throw magnets up very, very fast. Thus must be done in an evacuated tunnel or they will be vaporized.
Once you have this base you build the top of the building. It has huge magnets that catch the rising magnets and turn them around, throwing them back down. Newton's Third Law--the building is pushed up. The base does the same thing, throwing them back up. The stream of magnets supports the building, but note that they need no strength to do this. If the magnets are superconducting this uses no power. (You still will need power for the control systems and you will use a lot of power boosting them at the start.)
Once you have built this you use the magnets to lift the building top on it's magnets. Now you build the next to top floor. It does not turn the magnets around, it just extracts energy from the magnets heading up and uses that energy to push the magnets going down. Once again, superconductors. When it's ready you turn up the power on the base so the magnet streams can support the new floor also.
Repeat again and again until your building reaches space.
Your engineering must be very, very good--while you certainly have redundancy build in but if too many systems are down your tower collapses. You had also better keep the magnets in their paths, the results of a magnet touching their channels will be dramatic and once a track is breached air will get in and vaporize every magnet in the channel. Goodbye tower.