Meaning of inner product $\langle \vec{r} | \psi(t)\rangle $ I have come across the equation which comes out of the nothing  in Zettili's book Quantum mechanics concepts and applications p. 167:
$$\psi(\vec{r},t) ~=~ \langle \vec{r} \,|\, \psi(t) \rangle.$$ 
How do I know that I get function of position and time if i take an inner product of a state vector with an vector $\vec{r}$? Where is the proof?
 A: 
I don't get it why among all possibilities we chose the inner product?

(1)  The position eigenstates are complete:
$$1 = \int \mathrm{d}x \, |x\rangle \, \langle x |$$ 
(2)  The state, expressed as a weighted "sum" of position eigenstates where the weights are given by the probability amplitude, i.e., the position wavefunction:
$$|\psi(t)\rangle = \int \mathrm{d}x \, |x\rangle \, \psi(x,t)$$
(3) Now, let (1) operate on the state:
$$|\psi(t)\rangle = \int \mathrm{d}x \, |x\rangle \, \langle x |\psi(t)\rangle $$
To see that:
$$\psi(x,t) = \langle x |\psi(t)\rangle$$


Is this |x⟩⟨x| defined?

It is an operator that "projects" an arbitrary state "in the direction" of the state $|x\rangle$.  See, for example, Projection Operators and Completeness.

How did we get 2nd eq from first?

We didn't.  (2) simply expresses the fundamental property of a vector space that any state in the space can be expressed as the weighted sum of basis states.  For example, we could also write the state in terms of the momentum eigenstates:
$$|\phi(t)\rangle = \int \mathrm{d}k \, |k\rangle \, \phi(k,t)$$
where $\phi(k,t)$ is the momentum wavefunction and:
$$\phi(k,t) = \langle k |\phi(t)\rangle$$
A: The proof is probably not the right word since the expression $\Psi(x,t) = \langle{x}|{\Psi(t)}\rangle$ is actually the definition of position space wave function.
Basis in finite dimensional vector space
Any vector $|v\rangle$ from some finite dimensional vector space $V(F)$ can be written as a linear combination of basis vectors $|e_{i}\rangle$ from an ordered basis $( |e_{i}\rangle )_{i=1}^{n}$
$$
|v\rangle = \sum\limits_{i}^{n} c_{i} |e_{i}\rangle \, , \quad  (1)
$$
where $c_{i} \in F$.
And we say that with respect to chosen ordered basis $( |e_{i}\rangle )_{i=1}^{n}$ any vector $|v\rangle$ can be uniquely represented by an ordered collection, or $n$-tuple of the coefficients in its linear expansion over the basis 
$$
|v\rangle \longleftrightarrow ( c_{i} )_{i=1}^{n} \, .
$$
Finite dimensional inner product spaces
Now if we have a special kind of a vector space - an inner product space - a vector space with an inner product, i.e. a map $I(|v\rangle, |w\rangle)$ of the following form
\begin{equation}
    I(|v\rangle, |w\rangle): V(F) \times V(F) \to {F} \, , 
\end{equation}
with some properties defined for any two vectors $|v\rangle$ and $|w\rangle$ from the vectors space, we know how the coefficients $c_{i}$ looks like.
Taking the inner product of both sides of equation (1) with some basis vector $|e_{j}\rangle$ gives
$$
I(|e_{j}\rangle, |v\rangle) = \sum\limits_{i}^{n} c_{i} I(|e_{j}\rangle, |e_{i}\rangle) \, . \quad (2)
$$
Now since we can always orthonormalize our basis set so that
$$
I(|e_{j}\rangle, |e_{i}\rangle) = \delta_{ji} \, ,
$$
where $\delta_{ji}$ is the Kronecker delta
\begin{equation}
    \delta_{ji} = 
    \left\{ 
        \begin{matrix} 
            0, & \text{if } j \neq i \, ; \\
            1, & \text{if } j = i \, .
        \end{matrix} 
    \right. 
\end{equation}
equation (2) becomes
$$
I(|e_{j}\rangle, |v\rangle) = c_{j} \, .
$$
That is it basically. Each coefficient $c_{i}$ in equation (1) in inner product space is given by $I(|e_{i}\rangle, |v\rangle)$.
Oh, and if the inner product space is complete, i.e. it is a Hilber space, than we almost always use the following notation for an inner product
$$
I(|v\rangle, |w\rangle) = \langle v | w \rangle \, ,
$$
which is another story and so with respect to chosen ordered basis $( |e_{i}\rangle )_{i=1}^{n}$ any vector $|v\rangle$ in Hilbert space can be uniquely represented by an ordered collection, or $n$-tuple, of the coefficients $c_{i}$ given by $\langle e_{i} | v \rangle$
$$
|v\rangle \longleftrightarrow ( \langle e_{i} | v \rangle )_{i=1}^{n} \, .
$$
Infinite dimensional Hilbert space
We have infinite dimensional complex Hilbert space $H(\mathbb{C})$ and we would like to expand the state vector $|\Psi(t)\rangle$ over a set of eigenvectors of some self-adjoint operator which represent some observable.
If the spectrum of self-adjoint operator $\hat{A}$ is discrete then one can label eigenvalues using some discrete variable $i$
\begin{equation}
    \hat{A} |a_{i}\rangle = a_{i} |a_{i}\rangle \, ,
\end{equation}
and expansion of the state vector has the following form
$$
|\Psi(t)\rangle = \sum\limits_{i}^{\infty} c_{i}(t) |a_{i}\rangle, \quad \text{where} \quad c_{i}(t) = \langle a_{i} | \Psi(t) \rangle \, .
$$
So you have a a set of discrete coefficients $c_{i}(t)$ which can be used to represent the state vector. Each $c_{i}$ is basically complex number, but this number is different at different times and so it is written as $c_{i}(t)$.
But if the spectrum of self-adjoint operator is continuous then it is not possible to use discrete variable to label the eigenvalues, rather $a$ in the eigenvalue equation
\begin{equation}
    \hat{A} |a\rangle = a |a\rangle \, ,
\end{equation}
should be interpreted as continuous variable which is used to label eigenvalues and corresponding eigenvectors and expansion of the state vector looks like
\begin{equation}
    |\Psi(t)\rangle = \int\limits_{a_{min}}^{a_{max}} c(a,t) |a\rangle \, \mathrm{d}a, \quad \text{where} \quad c(a,t) = \langle a | \Psi(t) \rangle \, .
\end{equation}
So the the coefficients in the expansion are given not by a set of complex numbers labeled using discrete variable but rather as a complex-valued function of continuous variable. But this function $c(a,t)$ plays the same role: it determines the coefficients in the expansion. This time, however, you need a coefficient for each and every value of continuous variable $a$ and that's why they are given by a function. And again these coefficients different at different times.
Position operator $\hat{X}$ has continuous spectrum.
In the the simplest case - one particle in one spatial dimension - variable $x$ in
$$
\hat{X} |x\rangle  = x |x\rangle \, ,
$$
represents a position of the particle and runs over all possible values of position in one spatial dimension, i.e. $x \in \mathbb{R}$, and state vector is expanded over the set of eigenvectors $|x\rangle$ as
\begin{equation}
    |\Psi(t)\rangle = \int\limits_{-\infty}^{+\infty} \Psi(x,t) |x\rangle \,\mathrm{d}x, \quad \text{where} \quad \Psi(x,t) = \langle{x}|{\Psi(t)}\rangle \, .
\end{equation}
A: There is nothing to prove; this just involves making definitions as follows:
Let an element $|\psi\rangle$ of the Hilbert space $\mathcal H$ of a particle moving in three dimensions be given.  Let $|\mathbf x\rangle$ denote a simultaneous eigenstate of the position operators $X,Y,Z$ corresponding to eigenvalues $x,y,z$ where $\mathbf x = (x,y,z)$.  Then for each $\mathbf x\in\mathbb R^3$, the inner product
$$
  \langle \mathbf x|\psi\rangle
$$
is a complex number.  We can therefore define a function $\psi:\mathbb R^3\to\mathbb C$ as follows:
$$
  \psi(\mathbf x) = \langle \mathbf x|\psi\rangle
$$
If, instead, $|\psi(t)\rangle$ is a function $\mathbb R\to\mathcal H$ mapping $t\mapsto |\psi(t)\rangle$, then for each $(t,\mathbf x)\in \mathbb R\times\mathbb R^3$ the inner product
$$
  \langle \mathbf x|\psi(t)\rangle
$$
is a complex number, and we define a function $\psi:\mathbb R\times\mathbb R^3\to\mathbb C$ by
$$
  \psi(t,\mathbf x) = \langle \mathbf x|\psi(t)\rangle
$$
The motivation for these definitions is that when the function $\psi$ is defined in this way, it is the representation of the state $|\psi\rangle$ in the "basis" $|\mathbf{x}\rangle$ consisting of eigenvectors of the position operator.
See user kemiisto's great discussion below for details!
