P reduction between np-complete to np-complete given 2 lagnauges A,B which are npc.
is there a reduction function from A to B $A \leq_PB$ ?

my idea was to say that since they are decideable, 
we can do this:
$$
f(x) = \begin{cases} y \in B &amp; \text{ } if x \in A \\y \notin B &amp; \text{if }x \notin A.\end{cases}
$$

is this is correct? or its not something that can be true? / depands on p equal or not equal to np
Hint: What is the definition of "NP-complete"?