Slice the tofu into 1/4 inch slices. Put the flour into a medium bowl, add the salt and pepper and mix to combine. Dredge the tofu in the flour mixture.
Coat the bottom of a large skillet with olive oil. Heat over medium high heat. When the oil is hot and shiny, cook the tofu slices until their lightly browned and crispy, about 3 minutes per side. Remove the tofu slices from the pan and place them on a paper towel lined plate. You may need to do this in batches.
If making pasta, begin boiling the water and cook according to package directions.
While the tofu is cooking, start the sauce. In another pan, melt the butter (or heat the olive oil) over medium heat. Add the diced onion and cook until translucent, about 5 minutes. Add the vegetable broth and capers. Simmer for 5 more minutes, stirring occasionally. Mix in the lemon juice.
To serve, top a portion of spaghetti with slices of tofu. Pour 1/4 of the sauce over top of the pasta and tofu.