As you have specified python2.7, you can use the import_module function from the backported importlib module.
>>> np = importlib.import_module('numpy')
>>> cos = getattr(np, 'cos')
>>> cos
<ufunc 'cos'>
>>> cos(3.14159)
-0.99999999999647926
You would need to parse the command line options (using argparse as @HenryKeiter suggests in the comments), then split the function from the module string, import the module and use getattr to access the function.
>>> def loadfunc(dotted_string):
... params = dotted_string.split('.')
... func = params[-1]
... module = '.'.join(params[:-1])
... mod = importlib.import_module(module)
... return getattr(mod, func)
...
>>> loadfunc('os.getcwd')
<built-in function getcwd>
>>> loadfunc('numpy.sin')
<ufunc 'sin'>
>>> f = loadfunc('numpy.cos')
>>> f(3.14159)
-0.99999999999647926
Note this doesn't load functions from the global namespace, and you might want to add some error checking.
EDIT
There is also no need for the lambda function in this line
foo(lambda t: numpy.cos(t), x)
You can just pass numpy.cos directly without evaluating it
foo(numpy.cos, x)