In quantum mechanics, is $|\psi\rangle$ equal to $\psi(x)$?

To start, the kets are vectors, which means if we want an explicit realization of them, we would need to write them with respect to some basis. The first basis most people see is the position basis, where the basis kets are the states of definite position. Then, an arbitrary state $|\psi\rangle$ can be written as

$$ |\psi\rangle = \int_{-\infty}^{\infty}dx \ \psi(x)|x\rangle,$$

where $\psi(x)$ is the familiar position space wavefunction. This should help explain why the last line has the integral in it, it comes from this superposition of states of definite position.

Now for rewriting $\hat{H}|\psi\rangle = E|\psi\rangle$, the exact same thing happens, but the reason there aren't any integrals is because the $\hat{H}$ in $\hat{H}\psi(x) = E\psi(x)$ is written as an differential operator acting on position space now, rather than an operator that acts in some way on an arbitrary ket. This might be a slight abuse of notation, but it is usually clear from context what basis the Hamiltonian is written in in a given equation.

The state of a quantum system is an element of a vector space (a Hilbert space, specifically). The notation $|\psi\rangle$ is used to label a particular vector in this space. Operators such as $\hat{H}$ map states in the Hilbert space to other states in the Hilbert space, so $\hat{H} |\psi\rangle = |\phi\rangle$, where $|\phi\rangle$ is another state in the Hilbert space. Some vectors might be eigenvectors of an operator, in which case we might write $\hat{H}|\psi\rangle = E |\psi\rangle$ (where $E$ is just a regular number, the eigenvalue).

If we are considering a wavefunction that describes the real-space motion of a particle, then we might be interested in the spread of the wavefunction over space. The Hilbert space in this case is infinite-dimensional. A natural choice for the basis vectors in which to expand $|\psi\rangle$ is the position eigenstates $|x\rangle$, where $x$ is any position in real space. $|\psi\rangle$ can always be expressed as a superposition of different basis states with different amplitudes in each basis state: $$ |\psi\rangle = \int dx \ \psi(x)|x\rangle $$ where $\psi(x)$ is now a function that maps positions to some complex amplitude.

We can formally relate $\psi(x)$ to $|\psi\rangle$ as follows: take the inner product of the expansion of $|\psi\rangle$ in the position basis with any particular position eigenstate $|x'\rangle$: $$ \langle x' | \psi \rangle = \int dx \ \psi(x) \langle x' | x \rangle = \psi(x') $$ where we rely on the fact that different position eigenstates are orthogonal (ie., $\langle x' | x \rangle = \delta(x-x')$).

So $\psi(x) = \langle x | \psi \rangle$. That is, the amplitude of the wavefunction at a position $x$ is given by the projection of the state $|\psi\rangle$ onto the basis state defined at position $x$, $|x\rangle$.

This is something that also confused me for a while when I was first learning about quantum mechanics. First, I think it's important to understand the concept of different 'spaces'. Physicists deal with many different spaces: the usual old 3D real space we live in, and lots and lots of abstract 'spaces'.

The Hilbert space of a particle is the 'space' of all possible states the particle can be in. It is NOT the same 3D space that the particle actually 'moves around in'. The Hilbert space also obeys the usual laws of linear algebra, and it is infinite dimensional (every bit as infinite dimensional as real space is three dimensional).

In particular, the dimensionality is equal to the number of points in space, and the set of basis vectors is $\{\,|x\rangle\,|\,x\in \mathbb{R}\}$. The meaning of $|x\rangle$ as a state is ``the particle is located at x". $|x\rangle$ is also a basis vector of the Hilbert space; note that there is one for every x. So $|2.77\rangle$, $|-\sqrt{3}\rangle$, $|\pi\rangle$, and $|42\rangle$ are all basis vectors, as are an infinite other ones.

The important equation is actually $\langle x|\psi\rangle = \psi(x)$. This is the 'proper' version of your $|\psi \rangle \rightarrow \psi(x)$. The vector $|\psi\rangle$ lives in Hilbert space and is the abstract mathematical object representing the state of the particle. The equation $\langle x|\psi\rangle = \psi(x)$ essentially says that the scalar product of $| x\rangle$ and $|\psi\rangle$, or, 'the component of the vector $|\psi\rangle$ along the $|x\rangle$ direction' is equal to some number which we call $\psi(x)$. Because of the infinite dimension, you can take all of these scalar products (i.e. all the components of $|\psi\rangle$ along all the possible 'directions') and piece them together into a continuous function, the wave function.