The map() function takes a value that might be in one range and maps it to another range. The value might be a potentiometer reading, in the range 0 to 1023, and the other range might be 0 to 180, to position a servo. The potentiometer reading maps to a servo position, then.
I don't see how the map function is going to help you.
I have no idea what smooth function you are talking about.
It appears that you don't understand what you are getting from your accelerometer, either.
There are a number of projects in the robotics part of the forum that detail building self balancing robots. You need to spend some time there.