How to change an FCurve value in Python
An fcurve is made up of splines connecting key frame points.  FCurve.keyframe_points  a set of points (x, y) analogous to (frame, value). 

import bpy
context = bpy.context
# use action on active object

obj = context.object
action = obj.animation_data.action

# location fcurves
fcurves = [fc for fc in action.fcurves if fc.data_path == "location"]

# set value of all fcurves to value at frame
edit_frame = 1
edit_value = (10.0, 0.0, -1.0)

for fc in fcurves:
    axis = fc.array_index
    # remove keyframe points already at edit_frame
    [fc.keyframe_points.remove(p) for p in fc.keyframe_points
           if abs(p.co.x - edit_frame) &lt; 0.0001]
    # insert a keyframe
    fc.keyframe_points.insert(edit_frame, edit_value[axis])


Note this wont work for baked fcurves, which have sampled points.  The value of fcurve.evaluate(frame) will evaluate curve after applying any fcurve modifiers.