$$\int_0^\infty f(x) \cos(kx) \, dx=\frac {\sin(ak)} {k}$$
From the table fourier cos transform of Heasivide function is $\frac {\sin(ak)}{k}$
Let $f(x)\begin{cases}1, & 0\leq x \leq1 \\ 0 & x > 1 \end{cases}$
$$\ F_c(f(x))= \int_0^\infty f(x)\cos(kx) \, dx = \int_0^1 1\ \cos(kx)\ \text{d} x + 0 = \left[\frac{\sin(kx)}k\right]^1_0 = \frac{\sin(ak)}{k}$$
(not sure of this steps).
without using transform table, How can we get $f(x)=H(a-x)$?
Note that your last calculation is wrong, since you pop out a factor $a$ which as not present before.
Heaviside Theta in your case is defined as
$$\theta(a - x) = \begin{cases} 1 & 0 \leq x \leq a \\ 0 & x > a \end{cases}$$
Whence
$$\int_0^{+\infty} \theta(a-x)\cos(kx) \text{d}x = \int_0^a \cos(kx)\ \text{d}x = \frac{\sin (a k)}{k}$$