how to we know its an exponential function when given graph?

you can't be sure, but you do need to know the general shape of all exponential curves.