Why is this python script not working?
Background

This is how to create a new object and add the vertices in the verts list:

import bpy
import bmesh

verts = [(1, 1, 1), (0, 0, 0)]  # 2 verts made with XYZ coords
mesh = bpy.data.meshes.new("mesh")  # add a new mesh
obj = bpy.data.objects.new("MyObject", mesh)  # add a new object using the mesh

scene = bpy.context.scene
scene.objects.link(obj)  # put the object into the scene (link)
scene.objects.active = obj  # set as the active object in the scene
obj.select = True  # select object

mesh = bpy.context.object.data
bm = bmesh.new()

for v in verts:
    bm.verts.new(v)  # add a new vert

# make the bmesh the object's mesh
bm.to_mesh(mesh)  
bm.free()  # always do this when finished


This is how to alter an existing mesh:

import bpy
import bmesh

verts = [(1, 1, 1), (0, 0, 0)]  # 2 verts made with XYZ coords
mesh = bpy.context.object.data
bm = bmesh.new()

# convert the current mesh to a bmesh
bm.from_mesh(mesh)

for v in verts:
    bm.verts.new(v)  # add a new vert

# make the bmesh the object's mesh
bm.to_mesh(mesh)  
bm.free()  # always do this when finished


Answer

As for selection:

import bpy
import bmesh

mesh = bpy.context.object.data
bm = bmesh.new()

# convert the current mesh to a bmesh
bm.from_mesh(mesh)

# must run this so we can use indexing on the faces
bm.faces.ensure_lookup_table()

# "select" the 0th face by setting its select property to True
bm.faces[0].select = True

# make the bmesh the object's mesh
bm.to_mesh(mesh)  
bm.free()  # always do this when finished

# go back to edit mode to see the selection
bpy.ops.object.mode_set(mode='EDIT')


To test this:


Add a cube (go into edit mode and deselect all faces)
Paste the script into Blender's text editor
Hit run script in the text editor with the cube object still selected