Your confusion stems from the fast that this is a mixture of abuse of notation and having different Hilbert spaces to work with:
Generally the abstract operator $A$ acts on some abstract vector $|\psi\rangle$, for example the momentum operator $\hat p$ acts on its eigenstates $|p\rangle$ by $\hat p |p \rangle = p |p \rangle$.
In the wavefunction formalism, we say that for a Hilbert space that has some position basis $|x\rangle$, we can switch to the space of square-integrable functions $L^2(\mathbb{R})$ without loss of information by defining $\psi(x) = \langle x | \psi \rangle $. This $\psi(x)$ now is a scalar function, and it is a vector as an element of the Hilbert space $L^2(\mathbb{R})$. Now, operators on this Hilbert space must be operators on the functions, and it just so hpapens that the explicit form of the momentum operator is $\hat p = \mathrm{i}\hbar \partial_x $. This can be seen by considering the momentum operator as the generator of translations as per $T(\delta x) = 1 - \frac{\mathrm{i}}{\hbar}\hat p \delta x $ which must act as $T(\delta x) |x\rangle = |x + \delta x\rangle$ and then appying this to some $|\psi\rangle$. Let me know if you wish me to carry out that (not overly long) calculation.
Your comments have made it clearer to me what you actually want, the following is intended to address that:
In general, the kets $|\psi\rangle$ are elements of an abstract Hilbert space $\mathcal{H}$, we know nothing more about them.
In the context we are discussing, $\mathcal{H}$ is the space of states of a particle moving in one dimension, which we will call $\mathcal{H}_{1D}$. It is constructed by saying that there is an operator $\hat x$ on $\mathcal{H}_{1D}$ and a set of states $X := \{|x\rangle | x \in \mathbb{R} \}$ which are the eigenvectors of $\hat x$, i.e $\hat x | x \rangle = x | x \rangle\forall |x\rangle \in X$, and demanding that $X$ is a basis of $\mathcal{H}_{1D}$, where "basis" means a "rigged basis" as also explained in this answer of mine. In the following, none of the integrals and manipulations involving $\lvert x \rangle$ are fully mathematically rigorous.
Now, consider the Hilbert space of square integrable functions $ f : \mathbb{R} \rightarrow \mathbb{C} $, denoted $L^2(\mathbb{R},\mathbb{C})$. To every function $ \psi :\mathbb{R} \rightarrow \mathbb{C} $ with $\psi \in L^2(\mathbb{R},\mathbb{C})$, we define
the map
$$ \mathrm{Ket}: L^2(\mathbb{R},\mathbb{C})\rightarrow \mathcal{H}_{1D}, \psi \mapsto|\psi\rangle := \int_{-\infty}^\infty\psi(x)|x\rangle\mathrm{d}x,$$
where the integral is supposed to be a generalization of the usual basis decomposition $\sum_n c_n \vert n\rangle$ for a countable basis and should probably be some sort of Bochner integral, yet the space the $\lvert x\rangle$ live in is unfortunately not a Banach space, so this does not work straightforwardly.
Certainly, different functions $\psi,\psi'$ cannot generate the same ket this way, since for $\psi \neq \psi'$, we must have $\psi(x_0) \neq \psi'(x_0)$ at some $x_0 \in \mathbb{R}$, so the generated kets will differ, since the coefficient of at least one basis ket differs between them. Thus, this map is injective, and no information is lost.
Conversely, for a given ket $|\psi\rangle$ define the map
$$ \mathrm{Func} : \mathcal{H}_{1D} \rightarrow L^2(\mathbb{R},\mathbb{C}), |\psi\rangle\mapsto (\psi : \mathbb{R} \rightarrow \mathbb{C}, x \mapsto \langle x | \psi \rangle)$$
Ignoring that fact that the $\psi$ here is not always really a function, but belongs to the larger space of tempered distributions containing $L^2(\mathbb{R},\mathbb{C})$, we can again see that different kets cannot produce the same function $\psi$, since $\langle x | \psi\rangle$ gives the coefficents in the basis $X$, and two vectors with identical basis coefficents are identical. Thus, this map is also injective, and so also does not forget information.
Again, if you ignore the mathematical subtleties (which you shouldn't after you have become comfortable with the basic concepts!), these maps are actually inverses of each other, and thus show that there is no difference in the information encoded in $\mathcal{H}_{1D}$ and $L^2(\mathbb{R},\mathbb{C})$.
What about operators? Let me just exemplify this for the position operator $\hat x$. The scalar product of $L^2(\mathbb{R},\mathbb{C})$ is given by
$$ (\psi,\phi) = \int_{-\infty}^\infty \phi(x)\bar\psi(x)\mathrm{d}x\forall \phi, \psi \in L^2(\mathbb{R},\mathbb{C})$$
and the defining property of the position operator is that $\hat x |x\rangle = x|x\rangle$, and so applying the map $\mathrm{Func}$ to it yields $\langle \psi | \hat x | x\rangle = x \langle \psi | x \rangle$, which immediately yields $\mathrm{Func}(\hat x | x \rangle) = x \mathrm{Func}(|x\rangle)$ and means that representing $\hat x$ on $L^2(\mathbb{R},\mathbb{C})$ is nothing more that multiplying a function $\psi$ by the identity function $id_\mathbb{R}(x) = x$.