Think I finally got it.. Anyone able to tell me if it's right?

A(λ) = ∫(-∞ to ∞) f(x) cos(λx) dx

.......= ∫(-∞ to -1) f(x) cos(λx) dx + ∫(-1 to 1) f(x) cos(λx) dx + ∫(1 to ∞) f(x) cos(λx) dx

.......= ∫(-∞ to -1) 0 * cos(λx) dx + ∫(-1 to 1) 1 * cos(λx) dx + ∫(1 to ∞) 0 * cos(λx) dx

.......= ∫(x = -1 to 1) cos(λx) dx

.......= (1/λ) sin(λx) {for x = -1 to 1}

.......= 2 sin(λ)/λ.

Similarly,

B(λ) = ∫(-∞ to ∞) f(x) sin(λx) dx

.......= ∫(x = -1 to 1) sin(λx) dx

.......= (-1/λ) cos(λx) {for x = -1 to 1}

.......= 0.

Hence, f(x) = (1/π) ∫(x = 0 to ∞) [2 sin(λ)/λ] cos(λx) dx.