Are the wavefunctions $\psi(x)$, $e^{i\theta(x)}\psi(x)$, and $e^{i\phi}\psi(x)$ all the same? Can we say that two wavefunctions $\psi(x)$ and $e^{i\theta(x)}\psi(x)$ are the same even when $\theta$ depends on position $x$? Are they also same as $e^{i\phi}\psi(x)$ where $\phi$ is independent of $x$?
 A: No, the states $\psi(x)$ and $e^{i\theta(x)}\psi(x)$ are not the same.  The simplest way to see this is just to note that a wave function $\psi(x)=Ne^{ikx}$ (with a normalization constant $N$, which is irrelevant for this discussion) is an eigenstate of momentum $p=\hbar k$.  So two different states $\psi_{1}(x)=Ne^{ik_{1}x}$ and $\psi_{2}(x)=Ne^{ik_{2}x}=e^{i(k_{2}-k_{1})x}\psi_{1}(x)$ have different momenta.
Although the spatial probability densities are the same, the wave functions in the previous paragraph correspond to different momentum distributions.  This is generally the case for $\psi(x)$ and $e^{i\theta(x)}\psi(x)$.  Their position distributions are instantaneously the same, but they will have different momentum distributions unless $\theta(x)$ is a constant.*  That means that they will also have different distributions for the energy, and thus different time dependences under the Schrödinger equation.
*The overall phase of the wave function is not physical, so $\psi(x)$ and $e^{i\phi}\psi(x)$ do represent exactly the same state.
A: $\psi(x)$ and $\lambda \psi(x)$ correspond to the same physical state for any nonzero $\lambda\in \mathbb C$, because physical states are elements of a projective Hilbert space.
Because $e^{i\theta(x)}$ depends on position, $\psi(x)$ and $e^{i\theta(x)}\psi(x)$ do not correspond to the same states.  However, multiplication by $e^{i\theta(x)}$ does constitute a unitary transformation (if $\theta(x)\in\mathbb R$), so if you transform every wavefunction $\psi(x)\rightarrow e^{i\theta(x)}\psi(x)$ and transform every operator $A\rightarrow e^{i\theta(x)}A e^{-i\theta(x)}$, the physics remains precisely the same.

If you think of the wavefunction $\psi(x)$ as the expansion of an abstract state $|\psi\rangle$ in the "position basis" $|x\rangle$, i.e.
$$|\psi\rangle = \int \psi(x) |x\rangle dx$$
then you can think multiplication by $e^{i\theta(x)}$ as being a change of phase for each $|x\rangle$.  That is, if we let $|x'\rangle = e^{i\theta(x)}|x\rangle$, then the unitary operator $U$ which maps $|x\rangle$ to $|x'\rangle$ acts as follows:
$$U|\psi\rangle  =\int \psi(x) U|x\rangle dx = \int \psi(x)|x'\rangle dx = \int \psi(x)e^{i\theta(x)}|x\rangle dx$$
To change the phase for each $|x\rangle$ is to exercise the local $U(1)$ gauge symmetry in quantum mechanics.  It may appear to be a pointless exercise, but it becomes quite important when coupling quantum mechanics to electromagnetism, at which point it corresponds to a change of gauge for the electromagnetic 4-potential.
