changing from long to bytes and vice versa
So many problems here:

1) in function call there shouldn't be types, only arguments. byte LongVal_byte = my_function(LongVal);

2) &amp; before variable means "get variable address". However in function prototype long my_function2(byte &amp; LongVal_byte) it means reference to passed variable (and it must be byte), not a pointer.

3) pointer to local variable is returned from my_function. It might be working until pointed memory gets rewrited by something else (another function call or so)

And whole code might look like that:

long LongVal = -4080;
long LongVal2;

void setup(){
  Serial.begin(9600);
}

byte * my_function(long &amp; LongVal) {
  return (byte*)&amp;LongVal;
}

long my_function2(byte * LongVal_byte) {
  return *((long *)LongVal_byte);
}

void loop(){

  byte * LongVal_byte = my_function(LongVal);
  LongVal2 = my_function2(LongVal_byte);  

  Serial.println(LongVal2);  
  Serial.println(" "); 
}


But it is basically exactly the same as before without functions (just no need for memcpy)