I am tripping over something elementary (I think).
Given a smooth map $f\colon M\to N$ between smooth manifolds, the differential of $f$ at $p\in M$ is defined as \begin{align}\mathrm{d}_pf \colon T_pM &\to T_{f(p)}N\\ X&\mapsto X(-\circ f)\end{align} The gradient of $f\colon M\to \mathbb{R}$ at $p$ is, if I understand correctly, just the previous definition with $T_{f(p)}\mathbb{R}\cong\mathbb{R}$. But this is were I get confused, because immediately after the gradient of $f$ is defined by $$\mathrm{d}_pf(X):=X(f), \qquad \text{ with }X\in T_pM.$$ I understand this, since $\mathrm{d}_pf\colon T_pM\to\mathbb{R}$ (linearly) it is a covector and the right hand side works, but how can I see this as a special case of the above? (i.e. why does the $``\, -\ \circ\,''$ get dropped?)
And how do the elements of $T_{f(p)}\mathbb{R}$ act on real functions? (perhaps this is more like what I am looking for).