Cohen-Tannoudji says linear operators take a ket vector and associate them with another ket vector within $\mathscr{E}$ space.
That's the correct definition of an operator. Within the scope of quantum mechanics, anything that acts on one quantum state (i.e. ket) to produce another quantum state, in other words anything that can be written as
$$\text{[stuff]}\lvert a\rangle = \lvert b\rangle$$
is an operator. And assuming the transformation rule denoted by $\text{[stuff]}$ satisfies the conditions of linearity, it is further called a linear operator. But for the question you're asking, it's not really relevant whether or not the operator is linear.
Anyway, we have a transformation rule on kets, which I've denoted $\text{[stuff]}$. I use this notation to make the point that literally any combination of symbols which occurs in this context will represent an operator. It doesn't have to be a single letter, it doesn't have to have a hat over it. Sure, $A$ can represent an operator ($A\lvert a\rangle = \lvert b\rangle$), but you could also call an operator $\text{Bob}$ (as in $\text{Bob}\lvert a\rangle = \lvert b\rangle$), or label it with a smiley face. Or, in this case, you could label an operator $\hat{\psi}^\dagger(x)$, which you should think about first and foremost as just some combination of symbols that labels an operator.
Of course, there is a reason that Cohen-Tannoudji et al. choose that particular combination of symbols to label their operator. What you're dealing with here is not just a single, fixed operator, but a whole infinite set of operators, one associated with each spatial point $x$. In other words, $\hat{\psi}^\dagger(x)$ is the output of a mapping of points to operators. This is also known as an operator-valued field. The mapping is implicitly defined by the rule
$$\hat{\psi}^\dagger(x)\lvert 0\rangle = \lvert x\rangle$$
or in words,
$\hat{\psi}^\dagger$ maps the point $x$ to the operator which transforms the state $\lvert 0\rangle$ into the state $\lvert x\rangle$
(I'm assuming that $\lvert x\rangle$ and $\lvert 0\rangle$ have already been suitably defined, and that the operator space is suitably defined and/or restricted such that there is a unique choice of operator which transforms the latter into the former).
When you have an operator field, you can use it in many of the same ways you would use any other function; in particular, you can use it in an integral. Remember that an integral is, in principle, a sum of an infinite number of infinitesimal contributions. When you write something like
$$c = \int\mathrm{d}x f(x)$$
you're computing the product $f(x)\mathrm{d}x$ at every $x$ and adding them all up. You have a rule for adding up function values, so you can turn this integral into a number. Similarly, an integral like
$$\lvert c\rangle = \int\mathrm{d}x\lvert x\rangle$$
is the "weighted" sum of all the kets $\lvert x\rangle\mathrm{d}x$ (where $\mathrm{d}x$ is the "weight") associated with different positions. Unlike the earlier case, you may not be able to directly simplify this integral as is, other than just making up a new symbol for it ($\lvert c\rangle$), but you can "save" it until a later point in the calculation where you are able to do something with it. For example, if you're later asked to compute $\langle y\rvert c\rangle$, you can use the definition of $\lvert c\rangle$ to write
$$\langle y\rvert c\rangle = \langle y\rvert\biggl(\int\mathrm{d}x\lvert x\rangle\biggr) = \int\mathrm{d}x\langle y\rvert x\rangle = \int\mathrm{d}x\delta(y - x) = 1$$
or equivalently,
$$\langle y\rvert c\rangle = \langle y\rvert\biggl(\int\mathrm{d}x\hat{\psi}^\dagger(x)\lvert 0\rangle\biggr) = \int\mathrm{d}x\langle y\rvert \hat{\psi}^\dagger(x) \lvert 0\rangle = \int\mathrm{d}x\delta(y - x) = 1$$
Or if you're later asked to apply an operator to $\lvert c\rangle$, assuming the operator is linear (and thus commutes with integration), you can use the same sort of trick.
Finally, you mentioned being confused as to why $\hat{\psi}^\dagger(x)$ is written in a way that looks like a function but $\hat{a}_k^\dagger$ is written with a subscript. That's just an aesthetic choice; they both mean the same thing. Just as $\hat{\psi}^\dagger(x)$ is the operator associated with the point $x$ by some particular mapping, so $\hat{a}^\dagger_k$ is the operator associated with the wavenumber $k$ by some particular mapping. You could just as well write it as $\hat{a}^\dagger(k)$, or write the other one as $\hat{\psi}^\dagger_x$.