Must my gauge transformation be defined on all space? Consider the set-up of the Aharonov-Bohm effect with a solenoid of radius $a$ aligned along the $z$-direction and uniform magnetic field $B_0$ within. One possible vector potential, in cylindrical coordinates, is
$$A = \begin{cases}
\frac{B_0r}{2}\hat{\phi} \quad \text{for } r<a,\\
\frac{B_0a^2}{2r}\hat{\phi} \quad \text{for } r>a
\end{cases}$$
If I apply a gauge transformation using the gauge parameter $\Lambda = -\frac{B_0 a^2\phi}{2}$ so that $\nabla \Lambda = -\frac{B_0a^2}{2r}\hat{\phi}$, then I would be able to make the vector potential vanish outside the solenoid. Since physics (such as the phase difference measurable in the Aharonov-Bohm set-up) cannot depend on the gauge, there must be something wrong with my gauge transformation. 
Am I not allowed to take $\Lambda$ above to be my gauge parameter? It is easy to find examples in E&M where $A$ is ill-defined (i.e. infinity, due to $r=0$ in denominator) at some point in space so I am not sure if this is a problem that invalidates the proposed new $A$.
 A: There is nothing wrong with your gauge transformation.
Transforming the electromagnetic potentials
(vector potential $\vec{A}$ and scalar potential $\Phi$) by
$$\begin{cases}
\vec{A} &\to \vec{A} - \vec{\nabla}\Lambda \\
\Phi &\to \Phi + \frac{\partial}{\partial t}\Lambda
\end{cases} \tag{1}$$
doesn't change the electromagnetic fields ($\vec{E}$ and $\vec{B}$).
And as long we avoid quantum mechanics the transformation
(1) seems to be a perfect symmetry transformation.
But the situation changes when we add quantum mechanics
to describe the charged particles.
For a particle with charge $q$ the transformation (1) makes an
additional phase shift $\Delta\phi=q\Delta\Lambda/\hbar$ between
any two points of its trajectory. Hence it does change the physics,
i.e. it is not a symmetry transformation anymore.
This has been demonstrated in the Aharanov-Bohm effect. A charged particle
moving through a potential $\vec{A}$ aquires a phase change,
even when the magnetic field $\vec{B}$ is zero everywhere
along the trajectory of the particle.
It has even been verified experimentally.
Quoted from Wikipedia - Aharanov-Bohm effect - Magnetic solenoid effect:

An early experiment in which an unambiguous Aharonov–Bohm effect
   was observed by completely excluding the magnetic field from the
   electron path (with the help of a superconducting film)
   was performed by Tonomura et al. in 1986.

This seeming paradoxon was resolved by extending the transformation (1).
The complete transformation is defined as the combination of
gauge-transforming the electromagnetic potentials ($\vec{A}$ and $\Phi$)
and phase-transforming the wave function ($\psi$) of the charged particle
(see also UCSD Physics 130 - Gauge Symmetry in Quantum Mechanics).
$$\begin{cases}
\vec{A} &\to \vec{A} - \vec{\nabla}\Lambda \\
\Phi &\to \Phi + \frac{\partial}{\partial t}\Lambda \\
\psi &\to e^{-iq\Lambda/\hbar}\ \psi
\end{cases} \tag{2}$$
Only this combined gauge/phase transformation (2)
makes up a symmetry transformation,
i.e. it doesn't change the physics.
