There is no short answer to your question, and by posting it all at the same time will learn you less. Anyway there are lots of tutorials on how to do this out there.
I'm guessing you got the gallery and camera code done. Otherwise you may find it in the links below.
Gallery: Get/pick an image from Android's built-in Gallery app programmatically
Camera: Capture Image from Camera and Display in Activity
When you got your Uri from that captured or chosen picture, you can create a bitmap from it:
public Bitmap getBitmapFromUri(Uri uri)
{
return MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri);
}
Then you can set the bitmap to the imagebutton using following:
((ImageButton) findViewById(R.id.yourImageButton)).setImageBitmap(bitmap);
One of the links I pasted shows you how to get the path of the image. This path you can either save on your database, or save it with SharedPreferences. You can read about how to use it at the same link. Regarding the database, you know how to get the image path from my answer. Search google for database tutorials. But I think SharedPreferences will be enough depending on the scale of your application.
Good luck!